From eb4bc75111da45a17604fdff2f9eed0977f93dff Mon Sep 17 00:00:00 2001 From: MZuenni Date: Tue, 14 Feb 2023 16:41:24 +0100 Subject: moved more stuff --- string/suffixAutomaton.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'string/suffixAutomaton.cpp') diff --git a/string/suffixAutomaton.cpp b/string/suffixAutomaton.cpp index 69aa979..4d05b6e 100644 --- a/string/suffixAutomaton.cpp +++ b/string/suffixAutomaton.cpp @@ -11,7 +11,6 @@ struct SuffixAutomaton { SuffixAutomaton(const string &s) : states(2*sz(s)) { size = 1; last = 0; - states[0].length = 0; states[0].link = -1; for (auto c : s) extend(c - MIN_CHAR); } @@ -43,8 +42,7 @@ struct SuffixAutomaton { last = current; } - // Pair with start index and length of LCS. - // Index in parameter t. + // Pair with start index (in t) and length of LCS. pair longestCommonSubstring(const string &t) { int v = 0, l = 0, best = 0, bestpos = 0; for (int i = 0; i < sz(t); i++) { -- cgit v1.2.3