| 2 | /* Field testing: ICPC Live Archive 2755, ICPC Live Archive 4513, SPOJ DISUBSTR */ |
| 3 | |
| 4 | struct cmp { |
| 5 | int *idx; |
| 6 | string s; |
| 7 | cmp(int *_idx, string _s) : idx(_idx), s(_s) { } |
| 8 | bool operator()(int a, int b) const { |
| 9 | return s.substr(a) < s.substr(b); |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | struct naive_suffix_array { |
| 14 | string s; |
no outgoing calls