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.
1 parent 9a819e5 commit 802bfa0Copy full SHA for 802bfa0
atcoder/lazysegtree.hpp
@@ -56,7 +56,7 @@ struct lazy_segtree {
56
57
for (int i = log; i >= 1; i--) {
58
if (((l >> i) << i) != l) push(l >> i);
59
- if (((r >> i) << i) != r) push(r >> i);
+ if (((r >> i) << i) != r) push((r - 1) >> i);
60
}
61
62
S sml = e(), smr = e();
@@ -88,7 +88,7 @@ struct lazy_segtree {
88
89
90
91
92
93
94
{
@@ -105,7 +105,7 @@ struct lazy_segtree {
105
106
for (int i = 1; i <= log; i++) {
107
if (((l >> i) << i) != l) update(l >> i);
108
- if (((r >> i) << i) != r) update(r >> i);
+ if (((r >> i) << i) != r) update((r - 1) >> i);
109
110
111
0 commit comments