| 7 | using namespace atcoder; |
| 8 | |
| 9 | int main() { |
| 10 | static char buf[500'001]; |
| 11 | scanf("%s", buf); |
| 12 | string s = buf; |
| 13 | vector<int> sa = suffix_array(s); |
| 14 | long long answer = 1LL * s.size() * (s.size() + 1) / 2; |
| 15 | for (auto x : lcp_array(s, sa)) { |
| 16 | answer -= x; |
| 17 | } |
| 18 | printf("%lld\n", answer); |
| 19 | return 0; |
| 20 | } |
nothing calls this directly
no test coverage detected