kmp模板
kmp详解
模板题
#include"iostream"
#include"cstring"
using namespace std;
char s1[1000005],s2[1000005];
int nextt[1000005];
int len1,len2;
void get_next(){
nextt[0]=-1;
int i=0,j=-1;
while(i<len2){
if(j==-1||s2[i]==s2[j]){
nextt[++i]=++j;
}
else{
原创
2021-04-11 10:01:31 ·
79 阅读 ·
0 评论