Skip to content

Commit a837375

Browse files
authored
Update walk.hpp
1 parent e43234d commit a837375

File tree

1 file changed

+1
-1
lines changed
  • library/data_structures_[l,r]/seg_tree_uncommon

1 file changed

+1
-1
lines changed

library/data_structures_[l,r]/seg_tree_uncommon/walk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int walk(int l, int r, const auto& f) {
1414
}
1515
*/
1616
int good=0;
17-
while (l <= r) {
17+
while (l <= r-good) {
1818
int u = l + n, x = __lg(min(u & -u, r - l +1-good));
1919
if (f(s[u >> x])) good=1,r = l + (1 << x) - 1;
2020
else l += 1 << x;

0 commit comments

Comments
 (0)