Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 26d1428

Browse filesBrowse files
committed
fix duval
1 parent 7f82be0 commit 26d1428
Copy full SHA for 26d1428

File tree

Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed

‎Implementations/content/strings (14)/Light/LyndonFactor.h

Copy file name to clipboardExpand all lines: Implementations/content/strings (14)/Light/LyndonFactor.h
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ vs duval(str s) {
1313
int N = sz(s); vs factors;
1414
for (int i = 0; i < N; ) {
1515
int j = i+1, k = i;
16-
for (; j < n && s[k] <= s[j]; j++) {
16+
for (; j < N && s[k] <= s[j]; ++j) {
1717
if (s[k] < s[j]) k = i;
1818
else ++k;
1919
}
@@ -22,9 +22,9 @@ vs duval(str s) {
2222
return factors;
2323
}
2424
int minRotation(str s) {
25-
int n = sz(s); s += s;
26-
auto d = duval(s); int ind = 0, ans = 0;
27-
while (ans+sz(d[ind]) < n) ans += sz(d[ind++]);
25+
int N = sz(s); s += s;
26+
vs d = duval(s); int ind = 0, ans = 0;
27+
while (ans+sz(d[ind]) < N) ans += sz(d[ind++]);
2828
while (ind && d[ind] == d[ind-1]) ans -= sz(d[ind--]);
2929
return ans;
3030
}

‎Resources/Competition Math.md

Copy file name to clipboardExpand all lines: Resources/Competition Math.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you're still coming up with new ideas, keep thinking. Otherwise, you have sev
1313
* Leave it for a while and do something else if you actually want to solve it on your own.
1414
* Get a hint from someone else.
1515

16-
I'm impatient, so usually I go with the first option. Sometimes I end up reading a CF editorial before reading the statement? Idk if this is a good strategy tho. :/
16+
I'm impatient, so usually I go with the first option.
1717

1818
> I think something should be added or clarified.
1919

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.