# include# include # include using namespace std; char a1[1000010],a2[1000010]; int next[1000010]; int len1,len2,cot; void Getnext() { int i=0,j=-1; next[0]=-1; while(i<=len1) { if(j==-1||a1[i]==a1[j]) i++,j++,next[i]=j; else j=next[j]; } } void KMP() { int i,j; j=0; for(i=0; i