Skip to content

Commit d0cf278

Browse files
authored
Update walk.hpp
1 parent e307c45 commit d0cf278

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ int walk(int l, int r, const auto& f) {
22
for (l += n, r += n; l <= r;)
33
if (int u = nxt(l, r); f(s[u])) {
44
while (u < n)
5-
if (f(s[2 * u])) u = 2 * u;
6-
else u = 2 * u + 1;
5+
if (f(s[2 * u])) u *= 2;
6+
else (u *= 2)++;
77
return u - n;
88
}
99
return -1;

0 commit comments

Comments
 (0)