Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:WA的同学看看下面这样的数据对吗?In Reply To:WA的同学看看下面这样的数据对吗? Posted by:amisleeping at 2007-08-12 20:49:38 > ab > aaab > 本人WA就是因为没有考虑 next[len],和len 对应的字符是否相等的情况. > 第二组数据中 > > next[1]=0; > next[2]=1; > next[3]=2; > next[4]=3; > 因为 4,和 next[4]=3,所对应的字符不相等,所以不能用 len/(len-next[len])得到结果,如果不相等应该输出1. 非常感谢你的提示,wa很久了,终于ac啦 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator