test/cpv/library-checker-string/number_of_substrings.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/number_of_substrings | ||
| 2 | #include "../../../src/io/fastin/lib.hpp" | ||
| 3 | #include "../../../src/io/fastout/lib.hpp" | ||
| 4 | #include "../../../src/str/suffix_automaton/lib.hpp" | ||
| 5 | |||
| 6 | using namespace tifa_libs; | ||
| 7 | 24 | int main() { | |
| 8 | 24 | strn s; | |
| 9 | 24 | fin >> s; | |
| 10 | 24 | suffix_automaton sam; | |
| 11 |
2/2✓ Branch 6 taken 8550784 times.
✓ Branch 7 taken 24 times.
|
8550808 | for (auto c : s) sam.extend(u32(c - 'a')); |
| 12 | 24 | sam.build(), sam.getsz(); | |
| 13 | 24 | fout << sam.st[0].sz - 1; | |
| 14 | 24 | return 0; | |
| 15 | 24 | } | |
| 16 |