KMP
文章平均质量分 89
Moressette
ACMer
展开
-
KMP
TJRAC_ACM KMP课件及代码原创 2015-03-17 21:38:34 · 333 阅读 · 0 评论 -
POJ 2752 Seek the Name,Seek the Fame
Seek the Name, Seek the FameTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14048 Accepted: 6990DescriptionThe little cat is so famous, that many coup原创 2015-08-05 10:38:18 · 323 阅读 · 0 评论 -
POJ 1961 Period
PeriodTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 14636 Accepted: 6954DescriptionFor each prefix of a given string S with N characters (each chara原创 2015-08-03 16:24:49 · 376 阅读 · 0 评论 -
POJ2406 Power Strings
Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 37293 Accepted: 15409DescriptionGiven two strings a and b we define a*b to be their conca原创 2015-08-04 09:08:57 · 529 阅读 · 0 评论 -
HDU 3476 Cyclic Nacklice
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4037 Accepted Submission(s): 1818Problem DescriptionCC always原创 2015-08-03 12:31:51 · 406 阅读 · 0 评论 -
KMP算法和KMP算法中next数组的讲解
网上看了许多KMP算法的讲解,看来看去也是似懂非懂。只是看懂了正常情况下,字符串匹配逐个去找,会很慢,而KMP就是在一次匹配失败后,尽可能的往后移,去跳过那些没用的逐个查找,来达到字符串的快速匹配。但是看来看去只是明白个大概。尤其是对next数组很不理解,其实KMP中求next数组的这个函数就是个模板,每次照着敲一遍就ok了,但是我们如果想真正理解KMP,next数组函数并不需要逐行理解,但是我们原创 2015-07-28 10:08:04 · 589 阅读 · 0 评论 -
HDU 1711 Number Sequence
裸KMP,求给定的数字序列中是否有给出的子串,即模式串。如果有的话,输出与模式串匹配上的首字母下标。Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14806 Accepted Su原创 2015-07-28 10:06:45 · 306 阅读 · 0 评论 -
HDU 1686 Oulipo POJ 3461 Oulipo
KMP题。先输入模式串,再输入序列。求序列中有多少个模式串。这里求的是包含覆盖的情况。比如模式串是aa,序列是aaaaaa,要输出的结果是5而不是3。OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 28707 Accepted: 11470原创 2015-07-28 10:43:02 · 348 阅读 · 0 评论 -
HDU 2087 剪花布条
KMP。和之前那道HDU1686 Oulipo很像。区别是,这个不允许重复出现。即aaaaaa 模式串为aa。输出的结果为3,而那道Oulipo是5.两道都可以当模板来用~ HDU 1686 Oulipo代码:HDU 1686 Oulipo本题AC代码:#include #include #include using namespace std;char a[1005],b原创 2015-07-28 11:02:35 · 307 阅读 · 0 评论 -
HDU 2594 Simpsons’ Hidden Talents (KMP)
Simpsons’ Hidden TalentsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4441 Accepted Submission(s): 1611Problem DescriptionH原创 2015-08-05 11:26:39 · 349 阅读 · 0 评论