后缀自动机
sedcftyv
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
广义后缀自动机
同时处理多个字符串的字串问题 在线写法 const int N=1e6+10; int len[2*N],link[2*N],tr[2*N][32],con=2,last=1; int add(int c,int last) { if(tr[last][c]) { if(len[last]+1==len[tr[last][c]]) return tr[last][c]; int ne=con++,p=last,r=tr[last][c];原创 2020-07-24 21:47:52 · 153 阅读 · 0 评论 -
后缀自动机
求本质不同的字串个数 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=1000000+10; char s[N]; int len[2*N],tr[2*N][32],link[2*N],con=2,last=1; void add(int c) { int p,now=con++; len[now]=len[last]+1;原创 2020-07-24 13:54:04 · 259 阅读 · 0 评论
分享