P3808 【模板】AC自動機(簡單版)

#include<bits/stdc++.h> using namespace std; queue<int> q; const int N = 500010; struct AC_automaton { int c[N][26], val[N], fail[N], cnt; //c數組記錄字典樹節點,val數組爲該節點是否爲字符串結尾(個數)(記錄字符串結束的位置), fail記
相關文章
相關標籤/搜索