| 10 | suffix_automaton() : len(MAXL*2), link(MAXL*2), |
| 11 | occur(MAXL*2), next(MAXL*2), isclone(MAXL*2) { clear(); } |
| 12 | void clear() { sz = 1; last = len[0] = 0; link[0] = -1; |
| 13 | next[0].clear(); isclone[0] = false; } |
| 14 | bool issubstr(string other){ |
| 15 | for(int i = 0, cur = 0; i < size(other); ++i){ |
| 16 | if(cur == -1) return false; cur = next[cur][other[i]]; } |