Skip to content

Commit 8082285

Browse files
committed
revert
1 parent 83c9fa0 commit 8082285

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/library_checker_aizu_tests/data_structures/rmq_linear.test.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ int main() {
88
vector<int> a(n);
99
for (int i = 0; i < n; i++) cin >> a[i];
1010
linear_rmq rmq_less(a, less());
11+
linear_rmq rmq_less_equal(a, less_equal());
12+
vector<int> neg_a(n);
13+
for (int i = 0; i < n; i++) neg_a[i] = -a[i];
14+
linear_rmq rmq_greater(neg_a, greater());
15+
linear_rmq rmq_greater_equal(neg_a, greater_equal());
1116
while (q--) {
1217
int l, r;
1318
cin >> l >> r;
@@ -17,6 +22,16 @@ int main() {
1722
a[idx_right_min]);
1823
assert(l <= idx_right_min && idx_right_min < r);
1924
assert(rmq_less.query(l, r - 1) == a[idx_right_min]);
25+
assert(idx_right_min == rmq_greater.idx(l, r - 1));
26+
int idx_left_min = rmq_less_equal.idx(l, r - 1);
27+
assert(l == idx_left_min ||
28+
rmq_less_equal.query(l, idx_left_min - 1) >
29+
a[idx_left_min]);
30+
assert(l <= idx_left_min && idx_left_min < r);
31+
assert(
32+
idx_left_min == rmq_greater_equal.idx(l, r - 1));
33+
assert(a[idx_right_min] == a[idx_left_min]);
34+
assert(idx_left_min <= idx_right_min);
2035
cout << a[idx_right_min] << '\n';
2136
}
2237
}

0 commit comments

Comments
 (0)