| Task: | Dynamic Range Minimum Queries |
| Sender: | aalto26dh_007 |
| Submission time: | 2026-09-21 09:57:37 +0300 |
| Language: | C++ (C++23) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | details |
| #2 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <iostream>
#include <vector>
#include <string>
#include <format>
int main (int argc, char **argv) {
int n, q;
std::cin >> n >> q;
std::vector<int> numbers;
numbers.reserve(n);
for (int i=0; i<n; i++) {
int num;
std::cin >> num;
numbers.push_back(num);
}
//std::cout << std::format("{}", numbers) << std::endl;
std::string result;
for (int i=0; i<q; i++) {
int t, a, b;
std::cin >> t >> a >> b;
if (t == 1) {
numbers.at(a-1) = b;
} else {
a--;
b--;
if (numbers.at(a) < numbers.at(b)) {
result = result + std::to_string(numbers.at(a)) + '\n';
} else {
result = result + std::to_string(numbers.at(b)) + '\n';
}
}
}
std::cout << result << std::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 6 4 6 2 ... |
Feedback: Incorrect character on line 4 col 1: expected "4", got "6"
Test 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 200000 200000 398739055 65343131 699208332 3... |
| correct output |
|---|
| 28609 129890 20378 20378 311522 ... |
| user output |
|---|
| (empty) |
