![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
[字符串]后缀数组
adnizna
这个作者很懒,什么都没留下…
展开
-
[PKU/POJ][3261][Milk Patterns][后缀数组]
题目意思可以归结为给一个字符串,求可重叠的 k 次最长重复子串。 二分 k ,然后在 height 数组中找是否存大连续 k 个数都大于 k。 代码: #include <stdio.h> #include <stdlib.h> #include <string.h> int const N= 1000100; int wa[N], wb[N...2010-04-27 15:58:43 · 92 阅读 · 0 评论 -
[PKU/POJ][3294][Life Forms][后缀数组]
给你 n 个字符串,求出最长的子串,使得子串在大于一半的字符串中都出现。 先将 n 个字符串用 n 个不同的字符连接起来。求出 height 数组后,二分子串长度 k, 查找是否存在连续的大于 n/ 2+ 1 个后缀的 height 值都大于 k。这里要求这 n/ 2+ 1 都属于不同串,可以用一数组进行标记,具体做法详见代码。 代码: #include <cstdio> ...2010-04-28 14:06:24 · 158 阅读 · 0 评论 -
[FZU/FOJ][1872][A New Sequence Problem][后缀数组]
问题最终转化为,求出 height 数组后,求 max{ (j- i+ 1)* ( min( height[i..j] ) ) },相当于找一个最大的矩形。 求F(a^b)% c 因为 c 比较小,可求出其循环节。 代码: #include <stdio.h> #include <stdlib.h> #include <string.h> ty...2010-04-29 13:21:36 · 82 阅读 · 0 评论