Skip to content

Commit 8bdd010

Browse files
committed
golf
1 parent b27f5e2 commit 8bdd010

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/data_structures/uncommon/linear_rmq.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ template<class T, class F> struct linear_rmq {
2424
while (st.back() != -1 &&
2525
(i == sz(a) || !cmp(a[st.back()], a[i]))) {
2626
if (prev != -1) head[prev] = st.back();
27-
int pw2 =
28-
bit_floor(unsigned((end(st)[-2] + 1) ^ i));
27+
int pw2 = 1 << __lg((end(st)[-2] + 1) ^ i);
2928
t[st.back()][0] = prev = i & -pw2;
3029
st.pop_back();
3130
t[st.back() + 1][1] |= pw2;

0 commit comments

Comments
 (0)