Skip to content

Commit d9be0de

Browse files
committed
save another line
1 parent ff9f5fd commit d9be0de

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

library/data_structures_[l,r]/linear_rmq.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ template<class T, class F> struct linear_rmq {
2020
linear_rmq(const vector<T>& a, F cmp):
2121
n(sz(a)), a(a), cmp(cmp), in(n), asc(n), head(n + 1) {
2222
vi st(n + 1, -1);
23-
int t = 0;
24-
rep(i, 0, n + 1) {
23+
for (int i = 0, t = 0; i <= n; i++) {
2524
int prev = 0;
2625
while (t && (i == n || !cmp(a[st[t]], a[i]))) {
2726
head[prev] = st[t];

0 commit comments

Comments
 (0)