diff --git a/atcoder/lazysegtree.hpp b/atcoder/lazysegtree.hpp index 066e148..ae56e0f 100644 --- a/atcoder/lazysegtree.hpp +++ b/atcoder/lazysegtree.hpp @@ -88,7 +88,7 @@ struct lazy_segtree { for (int i = log; i >= 1; i--) { if (((l >> i) << i) != l) push(l >> i); - if (((r >> i) << i) != r) push((r - 1) >> i); + if (((r >> i) << i) != r) push(r >> i); } { @@ -105,7 +105,7 @@ struct lazy_segtree { for (int i = 1; i <= log; i++) { if (((l >> i) << i) != l) update(l >> i); - if (((r >> i) << i) != r) update((r - 1) >> i); + if (((r >> i) << i) != r) update(r >> i); } }