Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2012年11月18日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1358KMPView Code 1 #include <cstdio> 2 using namespace std; 3 4 const int N=1000010; 5 char s[N]; 6 int fail[N]; 7 void getfail(char *sp) 8 { 9 fail[0]=-1;10 for(int i=1,j=-1;sp[i];i++)11 {12 while(j!=-1 && sp[i]!=sp[j+1]) j=fail[j];13 ... 阅读全文
posted @ 2012-11-18 19:02 Qiuqiqiu 阅读(97) 评论(0) 推荐(0) 编辑