kmp
文章平均质量分 55
yukang_0613
这个作者很懒,什么都没留下…
展开
-
hdu2087
#include #include const int maxn=2000; int f[maxn],p[maxn]; void getfail(char *s){ f[0]=0; f[1]=0; int len=strlen(s); for(int i=1;ilen;i++) { int j=f[i]; while(j&原创 2016-07-11 11:14:22 · 384 阅读 · 1 评论 -
codevs1204 寻找子串位置
题目描述 Description 给出字符串a和字符串b,保证b是a的一个子串,请你输出b在a中第一次出现的位置。 输入描述 Input Description 仅一行包含两个字符串a和b 输出描述 Output Description 仅一行一个整数 样例输入 Sample Input abcd bc原创 2016-10-30 19:38:20 · 400 阅读 · 0 评论