We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fe9b6fc + bf1cabd commit 211d72aCopy full SHA for 211d72a
atcoder/string.hpp
@@ -213,10 +213,12 @@ std::vector<int> suffix_array(const std::string& s) {
213
template <class T>
214
std::vector<int> lcp_array(const std::vector<T>& s,
215
const std::vector<int>& sa) {
216
+ assert(s.size() == sa.size());
217
int n = int(s.size());
218
assert(n >= 1);
219
std::vector<int> rnk(n);
220
for (int i = 0; i < n; i++) {
221
+ assert(0 <= sa[i] && sa[i] < n);
222
rnk[sa[i]] = i;
223
}
224
std::vector<int> lcp(n - 1);
0 commit comments