题意
给出n个单词的字典,给出一个文本串,求文本串中每个单词出现了多少次。
题解
AC自动机,还是卡空间。卵用memset就MLE,用不带last就TLE。
所以就改了一蛤。
代码
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
const int nmax = 50007;
const int sigma = 128;
int occ_times[nmax];
char dictionay[1001][51];
int n,m,cnt;
char str[2000001];
struct Aho {
int sz;
queue<int> que;
struct Node {