![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
AC自动机
Unin88
这个作者很懒,什么都没留下…
展开
-
hdu 3065 病毒侵袭持续中
记录模板在文本中出现的次数,模板题。 AC代码: #include #include #include #include #include using namespace std; const int size = 128; const int MAX = 1010 * 55 + 10; char T[2000010]; char buf[101原创 2015-02-14 12:32:06 · 363 阅读 · 0 评论 -
hdu 2222 Keywords Search
AC自动机模板题,刚学习这个东西,有的地方还不是很明白。 代码: #include #include #include #include #include using namespace std; const int SIZE = 26; const int MAX = 10000*50 + 10; struct Trie{ int next[M原创 2015-02-13 14:05:45 · 335 阅读 · 0 评论 -
hdu 2896 病毒侵袭
代码: #include #include #include #include #include using namespace std; const int SIZE = 128; const int MAX = 200 * 500 + 10; struct Trie{ int next[MAX][SIZE],end[MAX],fail[MAX原创 2015-02-13 15:04:05 · 304 阅读 · 0 评论 -
UVa LA 4670 Dominating Patterns
此题是一个AC自动机,感觉是个裸题,WA了4发才过,只因为它告诉150个模板串,实际却有1000+ 代码: #include #include #include #include #include using namespace std; const int size = 26; const int MAX = 1010 * 150 + 10;原创 2015-02-14 11:45:13 · 419 阅读 · 0 评论