Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:WA的同学看看下面这样的数据对吗?

Posted by derek_zhang at 2013-09-10 15:29:14 on Problem 2406
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.

感谢。一定要用算法导论上面的写法,网上的常见写法太坑爹了。不好理解

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator