![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP
文章平均质量分 74
拥抱技术
学习就像谈恋爱!
展开
-
Count the string
Count the stringTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 5 Accepted Submission(s) : 2Problem DescriptionIt is well known原创 2014-04-04 21:34:58 · 1239 阅读 · 0 评论 -
Period 和 字符串周期
PeriodTime Limit : 6000/3000ms (Java/Other) Memory Limit : 60000/30000K (Java/Other)Total Submission(s) : 16 Accepted Submission(s) : 3Problem DescriptionFor each prefix of a given原创 2014-04-05 17:37:22 · 1785 阅读 · 0 评论 -
Oulipo
OulipoTime Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 11 Accepted Submission(s) : 4Problem DescriptionThe French author Georg原创 2014-04-03 23:01:56 · 1004 阅读 · 0 评论 -
Number Sequence
Number SequenceTime Limit : 10000/5000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 5 Accepted Submission(s) : 4Problem DescriptionGiven two sequenc原创 2014-04-04 19:57:51 · 682 阅读 · 0 评论 -
亲和串
亲和串Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 3Problem Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世原创 2014-04-05 16:19:14 · 1470 阅读 · 0 评论 -
KMP 算法
KMP 算法 与 朴素算法相比少了不必要的重复工作,比如ABABCD串在C处失配应从第二个A处匹配,不是第一个A处匹配。所以KMP的关键是状态转移表(预处理时间是0(M)),总的时间复杂度是0(M + N)。状态转移就是模式串每个位置的最大相等子串。前提:#include #include #include using namespace std;char w[10010];原创 2014-04-03 23:58:37 · 1020 阅读 · 0 评论