#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N, X;
vector<int> H;
void init(int _N, vector<int> _H) {
N = _N;
H = _H;
X = max_element(H.begin(), H.end()) - H.begin();
}
int max_towers(int L, int R, int D) {
if (L < X && X < R && max(H[L], H[R]) <= H[X] - D) {
return 2;
} else {
return 1;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
273 ms |
916 KB |
Output is correct |
2 |
Correct |
809 ms |
1420 KB |
Output is correct |
3 |
Correct |
713 ms |
1480 KB |
Output is correct |
4 |
Correct |
915 ms |
1352 KB |
Output is correct |
5 |
Correct |
598 ms |
1352 KB |
Output is correct |
6 |
Correct |
514 ms |
1432 KB |
Output is correct |
7 |
Correct |
552 ms |
1432 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
336 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 |
698 ms |
1440 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
293 ms |
556 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 |
273 ms |
916 KB |
Output is correct |
2 |
Correct |
809 ms |
1420 KB |
Output is correct |
3 |
Correct |
713 ms |
1480 KB |
Output is correct |
4 |
Correct |
915 ms |
1352 KB |
Output is correct |
5 |
Correct |
598 ms |
1352 KB |
Output is correct |
6 |
Correct |
514 ms |
1432 KB |
Output is correct |
7 |
Correct |
552 ms |
1432 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
1 ms |
336 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 |
- |