diff --git a/atcoder/lazysegtree.hpp b/atcoder/lazysegtree.hpp index 066e148..f4c5e4f 100644 --- a/atcoder/lazysegtree.hpp +++ b/atcoder/lazysegtree.hpp @@ -56,7 +56,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 >> i); + if (((r >> i) << i) != r) push((r - 1) >> i); } S sml = e(), smr = e();