摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>#define N 1000005int next[N],len1,len2,ans;char s1[N],s2[N];void getnext(){ int k,j; len1=strlen(s1); next[0]=-1; j=0; k=-1; while(j<len1){ if(k==-1||s1[k]==s1[j]){ k++; j++; next[j]=k; } else k=next[k]; } return ;}int kmp(){ 阅读全文
posted @ 2012-09-27 11:41 xxx0624 阅读(547) 评论(0) 推荐(0) 编辑