ac automaton 专题
摘要:hdu2222 模板题 hdu2825 在ac自动机上的状压dp hdu3247 在ac自动机上bfs poj2778 求长度为n,不包含给定的m个字符串的任何一个的字符串的个数 其实就是求长度为n的路径,不包含给定字符串 ac自动机求出一个转移矩阵,矩阵快速幂
阅读全文
posted @
2017-01-09 19:47
_fukua
阅读(186)
推荐(0)
hdu2087__kmp
摘要:与上题不同的是: 在ans++; 后,要同时把j=0; 因为这道找出来的子序列不允许重叠,2个子序列要是重叠只能取其一嘛。 1 #include 2 #include 3 const int max=1000+10; 4 char p[max]; 5 char t[max]; 6 int f[m...
阅读全文
posted @
2015-03-01 16:56
_fukua
阅读(180)
推荐(0)
Oulipo__poj3461__kmp
摘要:1 #include 2 #include 3 const int maxm=1e4+5; 4 const int maxn=1e6+5; 5 char p[maxm]; 6 char t[maxn]; 7 int f[maxm]; 8 int ans; 9 void getfail()10 {1...
阅读全文
posted @
2015-03-01 16:44
_fukua
阅读(195)
推荐(0)
HDU1711_Number Sequence__kmp
摘要:水题 1 #include 2 #include 3 const int maxn=1e6+5; 4 const int maxm=1e4+5; 5 int p[maxm]; 6 int t[maxn]; 7 int f[maxm]; 8 int n,m; 9 void getfail()10 {1...
阅读全文
posted @
2015-03-01 16:27
_fukua
阅读(219)
推荐(0)