![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
后缀数组
文章平均质量分 77
zhhx2001
这个作者很懒,什么都没留下…
展开
-
后缀数组模版
要背过!!!!!!原创 2016-04-27 21:14:44 · 683 阅读 · 0 评论 -
bzoj1031(后缀数组)
数据范围,直接排序就好刚开始数组又开小了,wa。。。处理环形的话,就把原串再接到后面#include#include#include#includeusing namespace std; int n,s[700005],rank[700005],c[700000],t1[700005],t2[700005],sa[700005];char ch[700005],ans[原创 2016-08-07 08:23:43 · 355 阅读 · 0 评论 -
poj3261(后缀数组+二分)
给定一个字符串,求至少出现 k 次的最长重复子串,这 k 个子串可以重叠。二分长度,也是分组判定是否出现了k次,实际就是有没有组大于k的长度#include#include#include#include#includeusing namespace std;const int N=20005;const int inf=0x3f3f3f3f;int c[N*5原创 2016-08-07 16:23:04 · 378 阅读 · 0 评论 -
poj1743(后缀数组+二分)
不可重叠最长重复子串后缀数组后,二分最长长度,在维护长度不小于mid时,判断是否有两个位置之间的差>mid,表示不重叠,由此更新l,r#include#include#include#include#includeusing namespace std;const int N=20050;const int inf=0x3f3f3f3f;inline int read(原创 2016-08-07 15:43:02 · 497 阅读 · 0 评论 -
poj2406(未完成,各种re)
首先对c++ log函数的不理解。对log函数在st算法中的利用不清楚以及其细节。。对st在后缀数组中求两后缀lcp的用法并不清楚。。。三个问题。。。。#include#include#include#include#includeusing namespace std;const int N=200005;int f[N][25];int sa[N],s[原创 2016-08-07 18:20:50 · 343 阅读 · 3 评论 -
poj2774(后缀数组||字符串hash)
求两个串的最长公共子串将两个串连起来,求后缀数组,sa中相邻两个后缀如果不属于同一个模版,则用这个height更新答案,他们的最长公共前缀更新答案#include#include#include#include#include#include#define max(x,y) (x)>(y)?(x):(y)using namespace std;const int N=100原创 2016-08-07 10:51:44 · 398 阅读 · 0 评论 -
后缀数组求lcp(模版,st模版把
算模版?,不过这东西,顺着思路很好写啊,注意log的强制类型转环就行了原创 2016-08-12 11:48:48 · 1790 阅读 · 0 评论