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

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

Posted by amisleeping at 2007-08-12 20:49:38 on Problem 2406
In Reply To:兄弟,错误改过来啦吗? Posted by:amisleeping at 2007-08-12 09:16:33
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