#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int id;
int mx, mx2;
vector<int> a;
void init(int N, std::vector<int> H) {
id = N - 1;
a = H;
for (int i = 0; i < N - 1; ++i) {
if (H[i] > H[i + 1]) id = i;
}
for (int i = 0; i < id; ++i) {
mx = min(mx, H[i]);
}
for (int i = id + 1; i < N; ++i) {
mx2 = min(mx, H[i]);
}
}
int max_towers(int L, int R, int D) {
if (L < id && R > id) {
int mn1 = a[L], mn2 = a[R];
return (mn1 <= a[id] - D && mn2 <= a[id] - D ? 2 : 1);
}
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
227 ms |
976 KB |
12th lines differ - on the 1st token, expected: '2', 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 |
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 |
416 ms |
1360 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 |
231 ms |
556 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 |
Incorrect |
227 ms |
976 KB |
12th lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |