随笔分类 -  AC自动机

摘要://暴力,从每一行的开始处开始寻找要查询的字符#include#include#include#includeusing namespace std;char str[100005];int main(){ while(gets(str)){ for(int i=0; str[i... 阅读全文
posted @ 2014-09-15 23:19 hjzqyx 阅读(502) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 hdu 2896 病毒侵袭 ac自动机 3 从题意得知,模式串中没有重复的串出现,所以结构体中可以将last[](后缀链接)数组去掉 4 last[]数组主要是记录具有相同后缀模式串的末尾节点编号 。本题中主要是计算每一个模式串 5 在主串中有没有出现过,而不是计算出现... 阅读全文
posted @ 2014-06-22 01:54 hjzqyx 阅读(335) 评论(0) 推荐(0) 编辑
摘要:/* 啥也不说了,直接套模板。。。 */ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define N 500000 7 using namespace std; 8 9 class A... 阅读全文
posted @ 2014-06-17 00:31 hjzqyx 阅读(479) 评论(0) 推荐(0) 编辑