
kmp
文章平均质量分 67
olahiuj
我的女朋友不抽烟不喝酒不傲娇不化妆不存在
展开
-
Period_poj1961_kmp
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原创 2016-08-17 19:16:55 · 354 阅读 · 0 评论 -
Oulipo_poj3461_kmp
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原创 2016-08-13 21:54:24 · 547 阅读 · 0 评论 -
Power Strings_poj2406_kmp
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, exponentiation原创 2016-08-14 19:11:24 · 439 阅读 · 0 评论 -
Simpsons' Hidden Talents hdu2594 kmp
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 i原创 2017-05-01 20:17:47 · 377 阅读 · 0 评论 -
2017年09月07日提高组第一式 B
DescriptionAlice和Bob正在悄悄地给对方发信息,信息都是由英文小写字母组成的,他们约定,所有的字母都得经过一个字母表进行变换,以防泄漏。另一方面John却在监听。 John发现,Alice和Bob通信的时候,总是先发送加密后的密文,然后紧接着发送原文。 但是Alice和Bob似乎也意识到了似乎有人监听,有时候会随意中断了他们的通信。不过每次都是在发送完密文之后才停止传送的。也原创 2017-09-13 21:50:46 · 327 阅读 · 0 评论 -
2017年11月2日提高组T1 Sequence
DescriptionInputOutputHintSolution想像一下,把点在坐标系里面描出来就能发现实际上是要找出多少段连续m个点描出的平滑曲线与b平行(意会一下)。一个简单的方法是做一个差分数组,kmp判断有多少字串。差分数组相同保证了相邻两点的斜率相同(口胡)这里写了不太熟悉的字符串哈希做法。钦定这是一个1e9进制数,做一个前缀哈希。若两段数字的每一位同时相差固定的数字,那他们的差一定形原创 2017-11-08 19:38:48 · 205 阅读 · 0 评论 -
bzoj4462 [Jsoi2013]编程作业 kmp
Description 权限号过期了题面就不放了-_-| Solution 我好菜啊 显然两个串相等它们的大写字母一定都相等 对于小写字母我们记录它的前驱,那么除了第一个以外,两个小写字母相等可以得到它们各自到前驱的距离相等,反之亦然,用这样拓展过的相等条件做kmp就可以了。。 Code ...原创 2019-01-27 17:35:56 · 256 阅读 · 0 评论