摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2896思路:建立字典树时,把字符串单词节点信息改为id就可以,然后计算失配函数,再查找哪一个上面的病毒字符串在下面的网站信息中出现,AC自动机。 1 #include 2 #include 3 #incl... 阅读全文
posted @ 2015-01-31 10:54 null1019 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题意:上面的字符串在下面的文章中有多少个单词出现过。思路:AC自动机 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 char str[1000010]; 8 int t,n; ... 阅读全文
posted @ 2015-01-31 08:58 null1019 阅读(142) 评论(0) 推荐(0) 编辑