文章分类 -  acm字符串-AC自动机

hdu2896 输出可以匹配串的id(AC自动机)
摘要:end数组表示id,开一个used数组记录哪些被匹配过 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int used[505]; 7 struct AC 8 { 9 int next[... 阅读全文

posted @ 2015-02-03 20:12 xiao_xin 阅读(110) 评论(0) 推荐(0)

hdu2222 输出可以匹配串数目 (附AC自动机模板)
摘要:裸ac自动机,end数组表示以其结尾的数目 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct AC 7 { 8 int next[500020][26],fail[500020],end[500... 阅读全文

posted @ 2015-02-03 20:08 xiao_xin 阅读(131) 评论(0) 推荐(0)

导航