We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d263a75 commit ae6f5eeCopy full SHA for ae6f5ee
library/strings/suffix_array/suffix_array_short.hpp
@@ -11,13 +11,13 @@
11
//! @time O(n * log^2(n))
12
//! @space O(n)
13
auto sa_short(const auto& s) {
14
- const int n = sz(s), K = 6;
+ const int n = sz(s), x = 6;
15
vi sa(n), sa_inv(all(s)), lcp(n - 1);
16
iota(all(sa), 0);
17
- for (int j = 1; j <= n; j *= K) {
+ for (int j = 1; j <= n; j *= x) {
18
vi x(sa_inv);
19
auto cmp = [&](int i1, int i2) {
20
- rep(k, 0, K) {
+ rep(k, 0, x) {
21
int a = i1 + j * k < n ? x[i1 + j * k] : -1;
22
int b = i2 + j * k < n ? x[i2 + j * k] : -1;
23
if (a != b) return a < b;
0 commit comments