AC自动机
yxr0105
这个作者很懒,什么都没留下…
展开
-
poj3691 DNA repair dp AC自动机
poj3691 DNA repair 题意:求母串最少改变几个字母是母串的子串不含有匹配串。 题解:实在没有力气 并没有理解呜呜呜 贴一个我认为不错的吧 http://blog.csdn.net/wugj03/article/details/6763145#include<iostream> #include<cstdio> #include<cstring> #include<queue>原创 2016-02-01 22:20:03 · 435 阅读 · 0 评论 -
hdu2222&hdu3065 AC自动机模板题
不贴链接了 裸题 主要想练习模板 hdu2222:求目标串中出现了几个模式串。(不重复) hdu3065:求目标串中出现了几个模式串。(可重复) hdu2222:#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<queue> using namespace std; const i原创 2016-02-03 00:48:36 · 366 阅读 · 0 评论 -
poj2778 DNA Sequence AC自动机 dp 矩阵乘法
poj2778 DNA Sequence 题意:求仅有A G C T不含有k(k<=10)个长度为d(d<=10)串的长度为L(L<=2*10^9)的串有多少个%100000 题解: 做完感觉之前对AC自动机理解的还不够透彻。 做完就透彻了?也不一定。 首先 bzoj上有一道和这个差不多 不过是kmp而不是AC自动机 bzoj1009 题解:http://www.cnblogs.com/原创 2016-02-03 01:02:34 · 415 阅读 · 0 评论 -
【模板】AC自动机
参考lrj白书#include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int N=1000010; char S[N],SS[N];int n; struct AC{ queue<int>q; int ch[N][27]; int f[N]原创 2016-04-30 12:28:49 · 325 阅读 · 0 评论