
kmp
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
hdu 2203 亲和串
Problem Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。亲和串的定义是这样的:给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,那么原创 2015-04-04 16:10:38 · 541 阅读 · 0 评论 -
hdu5510 Bazinga
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 532 Accepted Submission(s): 220Problem DescriptionLadies and gentlemen, please原创 2015-11-03 20:19:49 · 1028 阅读 · 0 评论 -
hdu4300 Clairewd’s message
Problem DescriptionClairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing for sending it to ykwd. They had agreed that e原创 2015-06-15 19:48:20 · 568 阅读 · 0 评论 -
poj2406 Power Strings
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原创 2015-06-14 09:13:28 · 458 阅读 · 0 评论 -
hdu3336 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.原创 2015-06-15 16:26:12 · 569 阅读 · 0 评论 -
poj3080 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 w原创 2015-06-14 11:04:06 · 942 阅读 · 0 评论 -
poj2752 Seek the Name, Seek the Fame
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原创 2015-06-14 10:02:47 · 616 阅读 · 0 评论 -
hust1010 The Minimum Length
题目描述There 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 string B.原创 2015-06-13 19:22:14 · 622 阅读 · 0 评论 -
hdu1686 Oulipo
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原创 2015-06-12 12:08:03 · 891 阅读 · 0 评论 -
hdu1711 Number Sequence
Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] =原创 2015-06-12 09:34:08 · 739 阅读 · 0 评论 -
UVA 11475 Extend to Palindrome (kmp || manacher || 后缀数组)
题目链接:点击打开链接题意:给你一个串,让你在串后面添加尽可能少的字符使得这个串变成回文串。思路:这题可以kmp,manacher,后缀数组三种方法都可以做,kmp和manacher效率较高,时间复杂度是O(n),后缀数组时间复杂度是O(nlogn).思路是求出元串的后缀和反串的前缀匹配的最大长度。用后缀数组的时候求出l=lcp(i,len+1),判断l+i是不是等于len,如果等于那么就原创 2016-05-01 15:53:06 · 611 阅读 · 0 评论