KMP
猪猪奋斗记
这个作者很懒,什么都没留下…
展开
-
hdu2594 Simpsons’ Hidden Talents
在这里我想先说一声在做KMP题目前我们必须要弄清楚的一件事情就是next[]数组的意义到底是什么?next的意义在于当匹配失败以后,应当跳到搜索字串中的哪个位置继续比较 明白这点以后就不难理解接下来的代码了。DescriptionHomer: Marge, I just figured out a way to原创 2014-03-23 15:59:49 · 637 阅读 · 0 评论 -
POJ 3461
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 nor原创 2014-04-18 16:57:02 · 619 阅读 · 0 评论 -
POJ 2185Milking Grid
DescriptionEvery morning when they are milked, the Farmer John's cows form a rectangular grid that is R (1 <= R <= 10,000) rows by C (1 <= C <= 75) columns. As we all know, Farmer John is quite th原创 2014-04-18 16:58:41 · 702 阅读 · 0 评论 -
hdu1358
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,原创 2014-03-23 15:02:14 · 781 阅读 · 0 评论 -
POJ 2752 Seek the Name, Seek the Fame
DescriptionThe 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 name, and at the sa原创 2014-04-18 16:54:52 · 642 阅读 · 0 评论 -
HDU 2087 剪花布条
Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过原创 2014-04-18 17:04:57 · 725 阅读 · 0 评论 -
HDU 3336Count the string
Problem 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.原创 2014-04-18 17:00:57 · 613 阅读 · 0 评论 -
从头到尾彻底理解KMP
从头到尾彻底理解KMP 作者:July时间:最初写于2011年12月,2014年7月21日晚10点 全部删除重写成此文,随后的半个月从早到晚不断改进。1. 引言 本KMP原文最初写于2年多前的2011年12月,因当时初次接触KMP,思路混乱导致写也写得非常混乱,如此,留言也是“骂声”一片。所以一直想找机会重新写下KMP,但苦于一直以转载 2014-08-04 21:30:38 · 1033 阅读 · 0 评论