![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP
R_Misaya
这个作者很懒,什么都没留下…
展开
-
SDUT OJ 2463 学密码学一定得学程序
#include#include#include#define N 10010#define M 1000100using namespace std;int next[N];char s[M],t[N];void getnext(char s[]){ int i=0,j=-1,len; next[0]=-1; len=strlen(s); while(i<len)原创 2014-11-12 22:39:07 · 1022 阅读 · 0 评论 -
SDUTOJ 1449 子串
#include#include#includeusing namespace std;char s1[101],s2[21];int next[105],cont;void getnext(char s[]){ int j=-1,i=0,len; next[0]=-1; len=strlen(s); while(i<len) { if(j==-1||s[i]==s[j原创 2014-10-21 11:33:47 · 811 阅读 · 0 评论 -
SDUTOJ 2772 KMP简单应用
#include#include#include#define N 10000001using namespace std;char s[N],s1[N];int next[N];void getnext(char s1[]){ int j=-1,i=0,len; next[0]=-1; len=strlen(s1); while(i<len) { if(j==-1|原创 2014-10-19 13:40:46 · 807 阅读 · 0 评论 -
SDUTOJ 2476Period
#include#include#include#define N 1000010using namespace std;char s[N];int next[N];void getnext(char s[]){ int j=-1,i=0,len; next[0]=-1; len=strlen(s); while(i<=len) { if(j==-1||原创 2014-10-19 22:26:15 · 807 阅读 · 0 评论 -
SDUTOJ 2475 Power Strings
#include#include#include#define N 1000005int next[N];char s[N];using namespace std;void getnext(char s[]){ int j=-1,i=0,len; next[0]=-1; len=strlen(s); while(i<=len) { if(j==-1||s[i]原创 2014-10-20 23:39:29 · 748 阅读 · 0 评论