char p[maxn], t[maxn];
void get(void)
{
int i, j;
next[0] = next[1] = 0;
for(i = 1; i <= m; i++) {
j = next[i];
while(j && p[i] != p[j]) j=next[j];
next[i+1] = p[i]==p[j] ? j+1 : 0;
}
}
bool kmp(void)
{
int i, j;
for(i = 0, j = 0; i <= lengh; i++) {
while(j && t[i] != p[j]) j=next[j];
if(t[i] == p[j]) j++;
if(j == m) return true;
}
return false;
}