Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algo : Aho-Corasick
- void solve() {
- build_trie();
- aho_corasick();
- for (int q = 0; q < tQuery; q++) {
- NODE *p = root;
- for (char ch : dictinary[q]) {
- int v = ch - '0';
- p = p->next[v];
- }
- cout << dfs(p) << endl;
- }
- delete root;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement