| Task: | Dynamic Range Minimum Queries |
| Sender: | aalto26dh_020 |
| Submission time: | 2026-09-20 17:54:47 +0300 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | details |
| #2 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <bits/stdc++.h>
using namespace std;
#define F(n) for (int i = 0; i < n; ++i)
int main() {
int n, q;
cin >> n >> q;
vector<int> x;
F(n) {
int tmp;
cin >> tmp;
x.push_back(tmp);
}
vector<int> result;
F(q) {
int type, a, b;
cin >> type >> a >> b;
if (type == 1) {
x[a - 1] = b;
} else if (type == 2) {
int min = *min_element(x.begin() + a - 1, x.begin() + b - 1);
// cout << "min: " << min << endl;
result.push_back(min);
}
}
F(static_cast<int>(result.size())) {
cout << result[i] << endl;
}
return (0);
}Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 8 80 7 6 4 6 2 9 4 8 2 1 1 2 1 2 2 1 3 ... |
| correct output |
|---|
| 7 6 4 4 2 ... |
| user output |
|---|
| 7 7 6 4 4 ... |
Feedback: Incorrect character on line 2 col 1: expected "6", got "7"
Test 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 200000 200000 398739055 65343131 699208332 3... |
| correct output |
|---|
| 28609 129890 20378 20378 311522 ... |
| user output |
|---|
| (empty) |
