// incorrect/solution-ayaze-bitonic.cpp
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> H;
int max_idx;
void init(int _N, std::vector<int> _H) {
N = _N;
H = _H;
for (int i = 0 ; i < N ; i++) {
if (H[i] > H[max_idx]) {
max_idx = i;
}
}
}
int max_towers(int L, int R, int D) {
if (R <= max_idx || L >= max_idx || max(H[L], H[R])+D > H[max_idx]) return 1;
return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
510 ms |
916 KB |
Output is correct |
2 |
Correct |
1216 ms |
1456 KB |
Output is correct |
3 |
Correct |
976 ms |
1456 KB |
Output is correct |
4 |
Correct |
948 ms |
1436 KB |
Output is correct |
5 |
Correct |
988 ms |
1464 KB |
Output is correct |
6 |
Correct |
871 ms |
1360 KB |
Output is correct |
7 |
Correct |
836 ms |
1420 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
236 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 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 |
1 ms |
256 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 |
697 ms |
1444 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 |
333 ms |
576 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 |
1 ms |
256 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 |
510 ms |
916 KB |
Output is correct |
2 |
Correct |
1216 ms |
1456 KB |
Output is correct |
3 |
Correct |
976 ms |
1456 KB |
Output is correct |
4 |
Correct |
948 ms |
1436 KB |
Output is correct |
5 |
Correct |
988 ms |
1464 KB |
Output is correct |
6 |
Correct |
871 ms |
1360 KB |
Output is correct |
7 |
Correct |
836 ms |
1420 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
236 KB |
Output is correct |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
11 |
Incorrect |
1 ms |
256 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |