摘要:
题目传送门 Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15508 Accepted Submission(s 阅读全文
摘要:
string s; int Next[MAX]; int len; void get_next() { int i=0,j=-1; Next[i]=j;//初始化,next[0]=-1;-1表示没有前缀等于后缀。 for(i=1;i-1&&s[j+1]!=s[i]) j=Next[j];//回溯 if(s[j+1]==s[i]) j... 阅读全文