
KMP
西瓜君wtml
这个作者很懒,什么都没留下…
展开
-
kuangbin KMP D题
Problem Description 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 t原创 2017-09-13 13:33:05 · 300 阅读 · 0 评论 -
hdu2087 剪花布条 kmp STL暴力
Problem Description 一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input 输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则原创 2017-09-12 22:19:05 · 232 阅读 · 0 评论 -
hdu 1711 kuangbin 字符串 A KMP入门
Problem Description Given 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] = b[1], a[K原创 2017-09-12 21:58:30 · 310 阅读 · 0 评论 -
1277 字符串中的最大值 next数组的妙用
1277 字符串中的最大值基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 一个字符串的前缀是指包含该字符第一个字母的连续子串,例如:abcd的所有前缀为a, ab, abc, abcd。 给出一个字符串S,求其所有前缀中,字符长度与出现次数的乘积的最大值。 例如:S = “abababa” 所有的前缀如下:“a”, 长度与出现次数的乘积 1 *原创 2017-09-12 21:03:22 · 237 阅读 · 0 评论 -
Z.Theme Section
Problem Description It’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 in原创 2017-09-15 22:36:00 · 283 阅读 · 0 评论 -
经典算法manacher
https://segmentfault.com/a/1190000003914228 今天上午刷字符串题,有道题不会,原因是没有深入理解manacher算法,学习了这篇文章。 虽然没有完全理解,下次再来学习。(1) 解决长度奇偶性带来的对称轴位置问题Manacher算法首先对字符串做一个预处理,在所有的空隙位置(包括首尾)插入同样的符号,要求这个符号是不会在原串中出现的。这样会使得所有的串都是原创 2017-09-15 11:30:19 · 333 阅读 · 1 评论 -
U - Palindrome
Andy 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 larg原创 2017-09-15 10:26:09 · 230 阅读 · 0 评论 -
hdu 6153 A Secret KMP&&扩展KMP
Problem Description Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things t原创 2017-09-22 17:29:27 · 243 阅读 · 0 评论 -
O - String Problem
Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings: String Rank SKYLONG 1 KYLONGS 2 YLONGSK原创 2017-09-14 20:12:31 · 280 阅读 · 0 评论 -
N - Corporate Identity
Problem Description Beside 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原创 2017-09-14 18:43:30 · 209 阅读 · 0 评论 -
L - Clairewd’s message 扩展KMP
L - Clairewd’s messageClairewd 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 eac原创 2017-09-14 13:44:45 · 522 阅读 · 0 评论 -
kuangbin J - Simpsons’ Hidden Talents
Problem Description Homer: 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原创 2017-09-13 20:03:21 · 405 阅读 · 0 评论 -
kuangbin K - Count the string
Problem Description It 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. Fo原创 2017-09-13 19:36:48 · 196 阅读 · 0 评论 -
kuangbin KMP H题
H - Seek the Name, Seek the FameThe 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 nam原创 2017-09-13 18:33:13 · 386 阅读 · 0 评论 -
kuangbin KMP E题
Problem Description 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. Tha原创 2017-09-13 17:51:42 · 260 阅读 · 0 评论 -
kuangbin KMP G题
G - Power StringsGiven 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, exponent原创 2017-09-13 14:04:49 · 425 阅读 · 0 评论 -
kuangbin kmp B题
B - OulipoThe 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原创 2017-09-12 22:31:15 · 204 阅读 · 0 评论