orzorz 日常%学弟 华科的未来orz
1#include <cstdio> 2#include <cstring> 3 4using namespace std; 5 6struct tnode { 7 int s; 8 tnode *f, *w, *c[26]; 9} T[5000000], *Q[5000000]; 10int C; 11 12inline tnode *tnew() { 13 memset(T + C, 0, sizeof(tnode)); 14 return T + C++; 15} 16 17inline void AcaInsert …
阅读更多题意:给出n个模式串,一个文本串,问文本串中出现了多少各模式串。
思路:ac自动机裸题。代码风格来自bin神。静态数组的写法。
需要理解 在build fail的时候,先单独处理root的必要性。
阅读更多