字符串
endinggy0
这个作者很懒,什么都没留下…
展开
-
manacher算法--Palindrome--POJ3974
DescriptionAndy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, “Can you propose an efficient algorithm to find the length of the largest palindrome in a string?”A string is sa原创 2020-09-07 23:26:23 · 79 阅读 · 0 评论 -
KMP-Period
DescriptionFor 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 each i (2 <= i <= N) we want to know the largest原创 2020-07-24 19:15:47 · 52 阅读 · 0 评论 -
KMP-Theme Section
DescriptionIt’s time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative songs. To make the programs more interesting and challenging, the hosts are going to add some const原创 2020-07-24 18:58:49 · 64 阅读 · 0 评论 -
KMP-Simpsons’ Hidden Talents
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 a talent in politics, OK?Marge: OK.Homer: So I take some politic原创 2020-07-24 18:14:56 · 85 阅读 · 0 评论 -
KMP-最短循环节-Cyclic Nacklace
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 thinking about how to tide over the last days. Being inspired by原创 2020-07-24 16:01:05 · 222 阅读 · 0 评论 -
KMP-Count the string
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. For example:s: “abab”The prefixes are: “a”, “ab”, “aba”, “abab”原创 2020-07-24 15:14:07 · 69 阅读 · 0 评论 -
字符串-trie-统计难题
题目描述Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束.Output对于每个提问,给出以该字符串为前缀的单词的数量.S原创 2020-07-21 23:10:17 · 113 阅读 · 0 评论 -
字符串算法-KMP-Oulipo
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 Pair normal, mais tout s’affirmait faux. Tout avait Fair normal, d’abo原创 2020-07-21 21:56:24 · 239 阅读 · 0 评论