MCPcopy Create free account
hub / github.com/atcoder/ac-library / main

Function main

test/example/sa_practice.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace atcoder;
8
9int 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}

Callers

nothing calls this directly

Calls 3

suffix_arrayFunction · 0.85
lcp_arrayFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected