KMP
for (int i = 2, j = 0; i <= m; i ++ )
{
while (j && p[i] != p[j]) j = ne[j];
if (p[i] == p[j]) j ++ ;
ne[i] = j;
}
for (int i = 0, j = 0; i <= n; i ++ ) {
while (j && s[i] != p[j]) j = ne[j];
if (s[i] == p[j]) j++;
if (j == m){
// 匹配成功后的逻辑
cout << i - m + 1 << endl;
break;
}
}