摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3336 题意:给你一个字符串,问字符串每一个前缀在字符串中的出现总次数。 思路:kmp的应用,自身和自身进行匹配,每次匹配时,如果没有匹配到结束,模式串按next数组向后移动,出现匹配至结束的情况,匹配串往后移动一
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2087 http://acm.hdu.edu.cn/showproblem.php?pid=3746
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2594 题意:读入串1和串2,输出串2的前缀和串1的后缀最长公共部分和长度。 思路:将串1作为子串s2,串2作为主串s1,套用kmp.
阅读全文
摘要:Best RewardProblem DescriptionAfter an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasu...
阅读全文
摘要:Problem DescriptionGenerally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two st...
阅读全文
摘要:PeriodProblem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we wa...
阅读全文
摘要:Seek the Name, Seek the FameDescriptionThe little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat t...
阅读全文
摘要:Simpsons’ Hidden TalentsProblem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah,...
阅读全文
摘要:Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulip...
阅读全文
摘要:Cyclic NacklaceProblem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any sur...
阅读全文
摘要:Number SequenceTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 28715 Accepted Submission(s...
阅读全文
摘要:人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。 亲和串的定义是这样的:给定两个字符串s1...
阅读全文
摘要:Andy, 8, has a dream - he wants to produce hisvery own dictionary. This is not an easy task forhim, as the number of words that he knows is,well, not ...
阅读全文