自动机
文章平均质量分 55
yrc1993
这个作者很懒,什么都没留下…
展开
-
POJ 2778 DNA Sequence (AC自动机)
题意:检测所有可能的n位DNA串有多少个DNA串中不含有指定的病毒片段思路:ac自动机+矩阵快速幂,具体请参考http://hi.baidu.com/ccsu_010/item/7847a3c17f6fe2bc0d0a7b89感谢然哥的ac自动机的模版 http://blog.csdn.net/zz_1215/article/category/1145295#include #i原创 2013-05-18 14:17:13 · 470 阅读 · 0 评论 -
SPOJ 1812. Longest Common Substring II(后缀自动机)
借鉴然哥的 http://blog.csdn.net/zz_1215/article/details/8053262#include #include #include using namespace std;const int maxn = 200005;const int maxc = 26;const int inf = 1<<30;int go[maxn][26];原创 2013-08-13 22:17:03 · 928 阅读 · 0 评论 -
SPOJ 1811 Longest Common Substring(后缀自动机)
存个模板,感谢然哥的模板#include #include #include using namespace std;const int maxn = 500005;const int maxc = 26;int go[maxn][26];int len[maxn];int f[maxn];class suffix_automaton{ public: const原创 2013-08-13 18:17:40 · 785 阅读 · 0 评论