![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SAM
文章平均质量分 52
ZMOIYNLP
嗨嗨嗨嗨
展开
-
【spoj1812】Longest Common Substring II 【SAM】
呵呵……#include<bits/stdc++.h> using namespace std; const int maxn=100002; struct node{ node *f,*ch[26]; int len,ml,nl; }pool[maxn*2],*cur=pool,*tail=pool,*init=pool,*b[maxn<<1]; void add(int c,in原创 2015-05-02 22:26:08 · 1655 阅读 · 0 评论 -
【spoj1811】Longest Common Substring【SAM】
SAM又神又恶心- -#include<bits/stdc++.h> using namespace std; const int maxn=250010; struct node{ node *f,*ch[26]; int ml; }pool[maxn*2],*init=pool,*cur=pool,*tail=init; void add(int c,int len){原创 2015-05-02 22:24:53 · 1785 阅读 · 0 评论 -
关于后缀自动机的一点题目
更新中…… 后缀自动机~你为什么这么恶心~又这么神~ spoj1811LCS:拿A串建SAM然后拿B串跑一遍,能往下走就走,否则转移到他的父亲。代码戳这里。 spoj1812LCS:拿第一个串A建个SAM,然后对于每个节点额外维护两个信息nl、ml:nl表示当前串走到这个点时的匹配长度,ml表示目前为止所有串走到这个点时最小的匹配长度。因为对于一个节点他的father的Right集合一定包含这原创 2015-05-02 22:20:30 · 2333 阅读 · 0 评论