KMP
文章平均质量分 69
Byte__
ACM成长中。
展开
-
codeforce D. Password
D. Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAsterix, Obelix and their temporary buddies Suffix and Pr原创 2014-11-09 09:48:48 · 973 阅读 · 0 评论 -
HDU4763 Theme Section KMP
Theme SectionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2171 Accepted Submission(s): 1016Problem DescriptionIt's time fo原创 2015-10-22 12:11:59 · 387 阅读 · 0 评论 -
hdu 3336 Count the string KMP+DP
Count the stringTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6375 Accepted Submission(s): 2947Problem DescriptionIt is wel原创 2015-08-13 10:09:33 · 801 阅读 · 0 评论 -
HDU 2594 Simpsons’ Hidden Talents
Simpsons’ Hidden TalentsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3262 Accepted Submission(s): 1229Problem DescriptionH原创 2014-11-09 12:02:01 · 76 阅读 · 0 评论 -
以后KMP就按照这个方式写了。看了kuangbin的写法
/*pku3461(Oulipo), hdu1711(Number Sequence)这个模板 字符串是从0开始的Next数组是从1开始的*/#include #include using namespace std;const int N = 1000002;int next[N];char S[N], T[N];int slen, tlen;void getNe转载 2015-08-12 10:42:58 · 2108 阅读 · 1 评论 -
hdu 3746 Cyclic Nacklace KMP循环节问题
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4124 Accepted Submission(s): 1866Problem DescriptionCC always原创 2015-08-12 14:27:40 · 751 阅读 · 0 评论 -
POJ2752 Seek the Name, Seek the Fame
Seek the Name, Seek the FameTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14203 Accepted: 7077DescriptionThe little cat is so famous, that many coup原创 2015-08-12 18:55:50 · 656 阅读 · 0 评论 -
HDU 1711 Number Sequence
Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11789 Accepted Submission(s): 5380Problem DescriptionGiven tw原创 2014-11-03 17:17:35 · 819 阅读 · 0 评论 -
POJ 1961 period
PeriodTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 13584 Accepted: 6396DescriptionFor each prefix of a given string S with N characters (each chara原创 2014-11-09 16:40:55 · 884 阅读 · 0 评论 -
POJ 2406 Power Strings 简单KMP
Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 33389 Accepted: 13869DescriptionGiven two strings a and b we define a*b to be their conca原创 2014-11-09 16:09:44 · 815 阅读 · 0 评论 -
KMP算法next数组通俗理解,适合考研及基础学习者
KMP算法是主要用来做字符串的匹配,有一个文本次T和一个模式串P,就是拿模式串P去匹配文本串T。匹配的步骤分为两步,先做模式串自身匹配,即求出next数组;然后在进行T与P的匹配。那么可能会问,为什么要做模式串自身匹配,这么做的优点体现在哪里? next数组到底是干啥的?它的含义是什么?原创 2016-11-20 00:38:28 · 2411 阅读 · 0 评论