![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP算法
文章平均质量分 65
xiaoxinxinev5
每一只菜狗子都有一颗想成为大佬的xin;
展开
-
数据结构实验之串一:KMP简单应用
Problem Description 给定两个字符串string1和string2,判断string2是否为string1的子串。 Input 输入包含多组数据,每组测试数据包含两行,第一行代表string1(长度小于1000000),第二行代表string2(长度小于1000000),string1和string2中保证不出现空格。 Output 对于每组输入数据,若str原创 2017-02-13 16:36:32 · 231 阅读 · 0 评论 -
Power Strings
Problem Description Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, e原创 2017-02-13 16:38:31 · 208 阅读 · 0 评论 -
cyk追楠神系列三
Problem Description 众所周知,cyk给楠神写了一封信表白。作为有一个有礼貌的五好青年,楠神当然得给 cyk 写一封回信咯,俗称“好人信”。 楠神是一个非常有文采的人,他在信里引用了很多名言来安慰 cyk,有时候他觉得一句话很好的话,他会引用很多次。现在他想考考 cyk,在告诉 cyk 里面每句名言的情况下,看看 cyk 能不能找到每局名言在信里被引用了多少次。如果能找到原创 2017-02-13 16:40:58 · 674 阅读 · 0 评论