KMP
lao_kai_ybqy
这个作者很懒,什么都没留下…
展开
-
回文子串的最大长度(哈希,二分)
回文子串的最大长度题目链接如果一个字符串正着读和倒着读是一样的,则称它是回文的。给定一个长度为 N 的字符串 S,求他的最长回文子串的长度是多少。输入格式输入将包含最多 30 个测试用例,每个测试用例占一行,以最多 1000000 个小写字符的形式给出。输入以一个以字符串 END 开头的行表示输入终止。输出格式对于输入中的每个测试用例,输出测试用例编号和最大回文子串的长度(参考样例格式)。每个输出占一行。输入样例:abcbabcbabcbaabacacbaaaabEND输出样例:原创 2021-03-16 15:15:38 · 248 阅读 · 0 评论 -
剪花布条
剪花布条题目链接一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。Output输出能从花纹布中剪出的最多小饰条个数,如果一块都没有,那就老老实实输出0,每个结果之间应换行。Sam原创 2020-08-12 00:08:40 · 128 阅读 · 0 评论 -
Oulipo (KMP)
Oulipo题目链接The 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-08-12 17:04:10 · 447 阅读 · 3 评论 -
Cyclic Nacklace(next数组,最小循环节)
Cyclic Nacklace题目链接CC 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 ins原创 2020-08-13 12:13:29 · 108 阅读 · 0 评论 -
Period (KMP)
Period题目链接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 each i (2 <= i <= N) we want to know the largest原创 2020-08-13 21:16:49 · 382 阅读 · 0 评论