KMP
文章平均质量分 75
dlnumk
这个作者很懒,什么都没留下…
展开
-
HDU3336Count the string(KMP+动态规划)
Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. F原创 2017-05-02 12:20:54 · 246 阅读 · 0 评论 -
HDU1711 Number Sequence(裸KMP)
一道裸的KMP题,用模板直接上就行#include #include using namespace std;int Next[10005],a[1000000+5],b[10000+5];int i,j,n,m;void getNext(){ Next[1] = 0;Next[0] =0; for(i = 1;i<m;i++) { j =原创 2017-05-04 11:25:15 · 312 阅读 · 0 评论 -
HDU1358 Period(KMP找循环前缀)
Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. Th原创 2017-05-04 11:26:52 · 352 阅读 · 0 评论 -
kmp
这只是最简单的MP算法还可以进行进一步的优化KMP算法主要难点是对next数组的理解void getnext(char *s,int *next)//更新next数组{ int len = strlen(s);next[0] = 0;next[1] = 0;int i,j;for(i = 1;i<len;i++){j = next[i];while(j!=0&&...原创 2017-05-02 10:48:55 · 194 阅读 · 0 评论 -
HDU 1686 Oulipo
The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout原创 2017-05-08 15:44:34 · 176 阅读 · 0 评论 -
HDU 2087剪花布条
Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长原创 2017-05-08 15:49:59 · 435 阅读 · 0 评论 -
HDU3746 Cyclic Nacklace(KMP+最小循环节)
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8812 Accepted Submission(s): 3795Problem DescriptionCC always beco原创 2017-06-07 13:22:46 · 202 阅读 · 0 评论 -
HDU 1358 Period(最小循环节)
PeriodTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8107 Accepted Submission(s): 3903Problem DescriptionFor each prefix of a gi原创 2017-06-07 13:32:53 · 227 阅读 · 0 评论