随笔分类 -  AC_自动机

摘要:#include #include #include #include using namespace std;const int maxn = 130;struct node{ bool flg; int id; node *next[maxn],*fail; void Node(){ fail = NULL; flg = false; memset(next,NULL,sizeof(next)); }}arr[500000],*que[500000];int vis[505],num[10],cnt;char str[... 阅读全文
posted @ 2013-08-08 23:42 一生挚爱 阅读(166) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/niushuai666/article/details/7002823#include #include #include using namespace std;struct node{ int count; node *next[26],*fail; void Node(){ count = 0;fail = NULL; memset(next,NULL,sizeof(next)); }}arr[300005],*que[500005];char str[1000006];int cnt = 0;... 阅读全文
posted @ 2013-08-08 23:41 一生挚爱 阅读(176) 评论(0) 推荐(0)