We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78b05a3 commit 60546c3Copy full SHA for 60546c3
library/data_structures/uncommon/linear_rmq.hpp
@@ -21,7 +21,7 @@ template<class T, class F> struct linear_rmq {
21
vi st{-1};
22
rep(i, 0, n + 1) {
23
int prev = -1;
24
- while (st.back() != -1 &&
+ while (sz(st) > 1 &&
25
(i == n || !cmp(a[st.back()], a[i]))) {
26
if (prev != -1) head[prev] = st.back();
27
int b = bit_floor((end(st)[-2] + 1u) ^ i);
0 commit comments