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

Function sa_naive

test/unittest/string_test.cpp:13–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using ull = unsigned long long;
12
13std::vector<int> sa_naive(std::vector<int> s) {
14 int n = int(s.size());
15 std::vector<int> sa(n);
16 std::iota(sa.begin(), sa.end(), 0);
17 std::sort(sa.begin(), sa.end(), [&](int l, int r) {
18 return std::vector<int>{s.begin() + l, s.end()} <
19 std::vector<int>{s.begin() + r, s.end()};
20 });
21 return sa;
22}
23
24std::vector<int> lcp_naive(std::vector<int> s, std::vector<int> sa) {
25 int n = int(s.size());

Callers 1

TESTFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected