diff --git a/library/data_structures/uncommon/linear_rmq.hpp b/library/data_structures/uncommon/linear_rmq.hpp index bcf2e028..503308a8 100644 --- a/library/data_structures/uncommon/linear_rmq.hpp +++ b/library/data_structures/uncommon/linear_rmq.hpp @@ -24,8 +24,7 @@ template struct linear_rmq { while (st.back() != -1 && (i == sz(a) || !cmp(a[st.back()], a[i]))) { if (prev != -1) head[prev] = st.back(); - int pw2 = - bit_floor(unsigned((end(st)[-2] + 1) ^ i)); + int pw2 = 1 << __lg((end(st)[-2] + 1) ^ i); t[st.back()][0] = prev = i & -pw2; st.pop_back(); t[st.back() + 1][1] |= pw2; diff --git a/tests/.config/.cppcheck_suppression_list b/tests/.config/.cppcheck_suppression_list index 43162f09..b49f37a0 100644 --- a/tests/.config/.cppcheck_suppression_list +++ b/tests/.config/.cppcheck_suppression_list @@ -53,7 +53,7 @@ constVariableReference:library_checker_aizu_tests/handmade_tests/dsu_size.test.c constVariableReference:../library/trees/centroid_decomp_uncommon/count_paths_per_length.hpp:34 constVariablePointer:../kactl/content/numerical/FastFourierTransform.h:39 cstyleCast:../kactl/content/numerical/FastFourierTransform.h:39 -derefInvalidIterator:../library/data_structures/uncommon/linear_rmq.hpp:28 +derefInvalidIterator:../library/data_structures/uncommon/linear_rmq.hpp:27 derefInvalidIterator:library_checker_aizu_tests/handmade_tests/n_choose_k.test.cpp:13 unreadVariable:library_checker_aizu_tests/handmade_tests/permutation_tree_small.test.cpp:12 uninitvar:library_checker_aizu_tests/handmade_tests/seg_tree_find_small.test.cpp:41