# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
827934 |
2023-08-16T23:10:55 Z |
Seb |
Radio Towers (IOI22_towers) |
C++17 |
|
685 ms |
1872 KB |
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
ll k,h[100005];
void init(int N, std::vector<int> H) {
for (int i=0;i<N;i++) {
h[i] = H[i];
if (i>0 && i<N-1 && H[i] > H[i-1] && H[i] > H[i+1]) k = i;
}
return;
}
int max_towers(int L, int R, int D) {
if (L > k || k > R) return 1;
if (h[L] <= h[k]-D && h[R] <= h[k]-D) return 2;
else return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
305 ms |
1232 KB |
Output is correct |
2 |
Correct |
685 ms |
1776 KB |
Output is correct |
3 |
Correct |
629 ms |
1856 KB |
Output is correct |
4 |
Correct |
642 ms |
1872 KB |
Output is correct |
5 |
Correct |
622 ms |
1828 KB |
Output is correct |
6 |
Correct |
662 ms |
1832 KB |
Output is correct |
7 |
Correct |
528 ms |
1872 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 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 |
418 ms |
1832 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 |
182 ms |
592 KB |
1st lines differ - on the 1st token, expected: '7197', found: '2' |
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 |
305 ms |
1232 KB |
Output is correct |
2 |
Correct |
685 ms |
1776 KB |
Output is correct |
3 |
Correct |
629 ms |
1856 KB |
Output is correct |
4 |
Correct |
642 ms |
1872 KB |
Output is correct |
5 |
Correct |
622 ms |
1828 KB |
Output is correct |
6 |
Correct |
662 ms |
1832 KB |
Output is correct |
7 |
Correct |
528 ms |
1872 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 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 |
- |