随笔分类 -  Aho-Corasick automaton

摘要:ac自动机 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxnode=150*70+5; 7 char s[155][75]; 8 char in[1000000+5]; 9 struct Trie 10 { 11 int ch[maxnode][26]; 12 int val[maxnode]; 13 int f[maxnode]; 14 int cnt[155]; 15 int sz; 16 void init... 阅读全文
posted @ 2013-10-13 11:02 sooflow 阅读(233) 评论(0) 推荐(0) 编辑
摘要:AC自动机裸题 1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxnode=10000*50+5; 6 char in[1000000+5]; 7 struct Trie 8 { 9 int ch[maxnode][26];10 int val[maxnode];11 int fail[maxnode];12 int sz;13 void initial(){sz=1;memset(ch[0],0,sizeof(ch[0]));memset(val,0,sizeo... 阅读全文
posted @ 2013-10-12 18:01 sooflow 阅读(136) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示