Skip to content

Commit 802bfa0

Browse files
LorentLorent
Lorent
authored and
Lorent
committed
unify how to write the same operation
1 parent 9a819e5 commit 802bfa0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

atcoder/lazysegtree.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct lazy_segtree {
5656

5757
for (int i = log; i >= 1; i--) {
5858
if (((l >> i) << i) != l) push(l >> i);
59-
if (((r >> i) << i) != r) push(r >> i);
59+
if (((r >> i) << i) != r) push((r - 1) >> i);
6060
}
6161

6262
S sml = e(), smr = e();
@@ -88,7 +88,7 @@ struct lazy_segtree {
8888

8989
for (int i = log; i >= 1; i--) {
9090
if (((l >> i) << i) != l) push(l >> i);
91-
if (((r >> i) << i) != r) push(r >> i);
91+
if (((r >> i) << i) != r) push((r - 1) >> i);
9292
}
9393

9494
{
@@ -105,7 +105,7 @@ struct lazy_segtree {
105105

106106
for (int i = 1; i <= log; i++) {
107107
if (((l >> i) << i) != l) update(l >> i);
108-
if (((r >> i) << i) != r) update(r >> i);
108+
if (((r >> i) << i) != r) update((r - 1) >> i);
109109
}
110110
}
111111

0 commit comments

Comments
 (0)