
KMP算法
文章平均质量分 81
Aerolite坠落
这个作者很懒,什么都没留下…
展开
-
Power Strings(KMP算法)
题目描述 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, exponentiation原创 2014-02-11 21:24:49 · 895 阅读 · 0 评论 -
KMP简单应用
KMP简单应用 Time Limit: 1000MS Memory limit: 65536K 题目描述 给定两个字符串string1和string2,判断string2是否为string1的子串。 输入 输入包含多组数据,每组测试数据包含两行,第一行代表string1(长度小于1000000),第二行代表string2(长度小于1000000),str原创 2014-02-11 21:23:01 · 758 阅读 · 0 评论 -
Period(KMP算法)
题目描述 For 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. That is, for原创 2014-02-11 22:12:40 · 960 阅读 · 0 评论 -
Codeforces Round #269 (Div. 2) D题 MUH and Cube Walls(KMP)
题目地址:http://codeforces.com/problemset/problem/471/D 突然发现这个忘记发题解了。。CF比赛中第一次做出4道题。。 其实这题也挺水的。KMP是很容易想到的,关键在于一个差分处理。只要算出每两个相邻数之间的差,剩下的就是裸的KMP求匹配串个数了。 代码如下: #include #include #include #include #in原创 2014-10-02 20:10:40 · 1123 阅读 · 0 评论