标签:tle pre math har for tail i++ splay down
ctrl-i
ctrl-b
del
qwq!
void exkmp(char *s,char *t,int n) {
int l = 0,r = 0;
for(int i = 1; i <= n; i++) {
if(i <= r) p[i] = min(z[i-l+1],r-i+1);
while(i+p[i] <= n && s[i+p[i]] == t[1+p[i]]) p[i]++;
if(i+p[i]-1 > r) l = i, r = i+p[i]-1;
}
}
\(1+1=2\)
\[1+2=3\]
void exkmp(char *s,char *t,int n) {
int l = 0,r = 0;
for(int i = 1; i <= n; i++) {
if(i <= r) p[i] = min(z[i-l+1],r-i+1);
while(i+p[i] <= n && s[i+p[i]] == t[1+p[i]]) p[i]++;
if(i+p[i]-1 > r) l = i, r = i+p[i]-1;
}
}
标签:tle pre math har for tail i++ splay down
原文地址:https://www.cnblogs.com/mogeko/p/12486542.html