
字符串
文章平均质量分 82
your_own_name
这个作者很懒,什么都没留下…
展开
-
HDU 4300 Clairewd’s message
Clairewd’s messageProblem Description Clairewd 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 h原创 2017-02-17 10:32:16 · 338 阅读 · 0 评论 -
字符串最小表示法 O(n)算法
转载自:字符串最小表示法 O(n)算法 网上看了这篇文章后还是感觉有些地方讲的没有详细的证明所以添加了一点 红色字是博主写的 求字符串的循环最小表示: 上面说的两个字符串同构的,并没有直接先求出Min(s),而是通过指针移动,当某次匹配串长时,那个位置就是Min(s)。而这里的问题就是:不是给定两个串,而是给出一个串,求它的Min(s),eg:Min(“babba”) = 4。转载 2017-02-18 21:54:29 · 438 阅读 · 0 评论 -
扩展KMP
扩展的KMP问题:给定母串S,和子串T。 定义n=|S|, m=|T|,extend[i]=S[i..n]与T的最长公共前缀长度。请在线性的时间复杂度内,求出所有的extend[1..n]。 容易发现,如果有某个位置i满足extend[i]=m,那么T就肯定在S中出现过,并且进一步知道出现首位置是i——而这正是经典的KMP问题。 因此可见“扩展的KMP问题”是对经典KMP问题的一个扩充和加难。转载 2017-02-20 11:36:13 · 384 阅读 · 0 评论 -
SPOJ STC02 Antisymmetry——马拉车啊马拉车
AntisymmetryDescription Byteasar studies certain strings of zeroes and ones. Let S be such a string. By Sr we will denote the reversed (i.e., “read backwards”) string S, and by SI we will denote the原创 2017-02-23 23:21:21 · 345 阅读 · 0 评论