We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b47f737 commit f1f13f2Copy full SHA for f1f13f2
library/data_structures_[l,r]/seg_tree_midpoint.hpp
@@ -5,6 +5,6 @@
5
//! // [tl,tr] splits into [tl,tm] and [tm+1,tr]
6
//! @endcode
7
int split(int tl, int tr) {
8
- int pw2 = 1 << __lg(tr - tl + 1);
+ int pw2 = bit_floor(tr - tl + 1u);
9
return min(tl + pw2 - 1, tr - pw2 / 2);
10
}
0 commit comments