# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
817039 | 2023-08-09T08:44:52 Z | finn__ | Radio Towers (IOI22_towers) | C++17 | 693 ms | 1452 KB |
#include "towers.h" #include <bits/stdc++.h> using namespace std; constexpr size_t N = 100000; int subtask, h[N]; size_t peak_pos; void init(int n, vector<int> h_) { copy(h_.begin(), h_.end(), h); bool increasing = 1; subtask = 1; for (size_t i = 0; i + 1 < n; ++i) { if (h[i] < h[i + 1] && !increasing) { subtask = 2; break; } if (h[i] > h[i + 1]) increasing = 0; } if (subtask == 1) { while (peak_pos + 1 < n && h[peak_pos + 1] > h[peak_pos]) ++peak_pos; return; } } int max_towers(int l, int r, int d) { if (subtask == 1) { if (l >= peak_pos || r <= peak_pos) return 1; return (h[peak_pos] >= h[l] + d && h[peak_pos] >= h[r] + d) + 1; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 355 ms | 944 KB | Output is correct |
2 | Correct | 590 ms | 1432 KB | Output is correct |
3 | Correct | 626 ms | 1452 KB | Output is correct |
4 | Correct | 630 ms | 1440 KB | Output is correct |
5 | Correct | 589 ms | 1360 KB | Output is correct |
6 | Correct | 693 ms | 1440 KB | Output is correct |
7 | Correct | 613 ms | 1432 KB | Output is correct |
8 | Correct | 1 ms | 208 KB | Output is correct |
9 | Correct | 1 ms | 208 KB | Output is correct |
10 | Correct | 1 ms | 208 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | 1st lines differ - on the 1st token, expected: '13', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | 1st lines differ - on the 1st token, expected: '13', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 455 ms | 1332 KB | 1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 205 ms | 464 KB | 1st lines differ - on the 1st token, expected: '7197', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | 1st lines differ - on the 1st token, expected: '13', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 355 ms | 944 KB | Output is correct |
2 | Correct | 590 ms | 1432 KB | Output is correct |
3 | Correct | 626 ms | 1452 KB | Output is correct |
4 | Correct | 630 ms | 1440 KB | Output is correct |
5 | Correct | 589 ms | 1360 KB | Output is correct |
6 | Correct | 693 ms | 1440 KB | Output is correct |
7 | Correct | 613 ms | 1432 KB | Output is correct |
8 | Correct | 1 ms | 208 KB | Output is correct |
9 | Correct | 1 ms | 208 KB | Output is correct |
10 | Correct | 1 ms | 208 KB | Output is correct |
11 | Incorrect | 0 ms | 208 KB | 1st lines differ - on the 1st token, expected: '13', found: '1' |
12 | Halted | 0 ms | 0 KB | - |