![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
KMP
Joyyiwei
这个作者很懒,什么都没留下…
展开
-
CodeForces - 25E Test (KMP应用)
DescriptionSometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob has 3 wrong soluti原创 2014-08-06 14:17:49 · 1305 阅读 · 0 评论 -
POJ - 3080 Blue Jeans
DescriptionThe Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was原创 2014-09-15 14:39:57 · 1167 阅读 · 1 评论 -
HDU - 2594 Simpsons’ Hidden Talents
Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have原创 2014-09-15 15:26:08 · 880 阅读 · 0 评论 -
HDU - 3336 Count the string
Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. F原创 2014-09-15 17:06:01 · 1420 阅读 · 0 评论 -
POJ - 2406 Power Strings (KMP循环节)
DescriptionGiven 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, exponenti原创 2014-09-13 09:17:19 · 1001 阅读 · 0 评论 -
HUST - 1010 The Minimum Length
DescriptionThere is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I got a new string: AAAAAA...... Now I cut it from two different position and get a new str原创 2014-09-12 18:39:49 · 965 阅读 · 0 评论 -
POJ - 2752 Seek the Name, Seek the Fame (KMP的next[]应用)
DescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the sa原创 2014-09-13 10:03:20 · 1155 阅读 · 0 评论 -
HDU - 3746 Cyclic Nacklace (KMP求循环节)
DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinki原创 2014-09-12 16:17:18 · 1096 阅读 · 1 评论 -
HDU - 2203 亲和串
Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。亲和串的定义是这样的:给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,那么我们就说原创 2014-09-12 16:43:56 · 847 阅读 · 0 评论 -
HDU - 2087 剪花布条 (KMP)
Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个原创 2014-09-12 10:30:03 · 862 阅读 · 0 评论 -
HDU - 1686 Oulipo (KMP)
Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pa原创 2014-09-12 09:27:55 · 1280 阅读 · 0 评论 -
HDU - 1711 Number Sequence (KMP模板)
题意:找最早匹配的位置思路:KMP的模板题#include #include #include #include using namespace std;const int MAXN = 1000010;int a[MAXN],b[MAXN],next[MAXN];int n,m;void getnext(int b[]){ int i = 0,j = -1,len原创 2014-03-16 15:10:55 · 767 阅读 · 0 评论 -
UVA - 10298 Power Strings (KMP求字符串循环节)
DescriptionProblem D: Power StringsGiven two strings a and b we define a*b to be their concatenation. For example, ifa = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation a原创 2014-07-19 16:23:09 · 1230 阅读 · 0 评论 -
HDU - 2328 Corporate Identity
DescriptionBeside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like trademarks. One of such companies is Inter原创 2014-09-16 19:12:23 · 1902 阅读 · 0 评论