2019年2月11日

AC自动机模板

摘要: const int SIGMA_SIZE = 26; const int MAXNODE = 11000; struct AhoCorasickAutomata { int ch[MAXNODE][SIGMA_SIZE]; int f[MAXNODE]; // fail函数 int val[MAXNODE]; // 每个字符串的结尾结点都有一个非0的val ... 阅读全文

posted @ 2019-02-11 21:50 欣崽 阅读(182) 评论(0) 推荐(0)

KMP模板

摘要: struct KMP { void print() { } void GetFail(char *P,int *f) { int m=strlen(P); f[0]=f[1]=0; for(int i=1; i<m; i++) { int j=f[i]; while(j&&P... 阅读全文

posted @ 2019-02-11 21:49 欣崽 阅读(177) 评论(0) 推荐(0)

导航