summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoobie99 <noob999noob999@gmail.com>2023-03-29 12:23:14 +0200
committerNoobie99 <noob999noob999@gmail.com>2023-03-29 12:23:14 +0200
commit107d427b32e3b60072a9008dc19be37b0a2b3ce1 (patch)
treeb847e7e8f38490c513d56164ee66c48293592782
parent53abe93a51539eda9794351417c4573a305a40f2 (diff)
fix suffix Array when |s| = 1, reduced (useless?) memory usage
-rw-r--r--string/suffixArray.cpp2
-rw-r--r--tcr.pdfbin669694 -> 669802 bytes
2 files changed, 1 insertions, 1 deletions
diff --git a/string/suffixArray.cpp b/string/suffixArray.cpp
index 720148c..2423af7 100644
--- a/string/suffixArray.cpp
+++ b/string/suffixArray.cpp
@@ -5,7 +5,7 @@ struct SuffixArray {
vector<pair<pair<int, int>, int>> L;
SuffixArray(const string& s) : n(sz(s)), SA(n), LCP(n), L(n) {
- P.assign(__lg(n)*4-2, vector<int>(n));
+ P.assign(__lg(n)+2, vector<int>(n));
for (int i = 0; i < n; i++) P[0][i] = s[i];
for (step = 1, count = 1; count < n; step++, count *= 2) {
for (int i = 0; i < n; i++)
diff --git a/tcr.pdf b/tcr.pdf
index 329a87e..030dc14 100644
--- a/tcr.pdf
+++ b/tcr.pdf
Binary files differ