#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
#define eb emplace_back
#define mp make_pair
using ii = pair<int, int>;
int N, k;
vector<int> H;
void init(int N, vector<int> H) {
::N = N;
::H = H;
for (int i = 0; i < N; i++) {
if (i == N - 1 || H[i] > H[i + 1]) {
k = i;
break;
}
}
}
int max_towers(int L, int R, int D) {
if (!(L < k && k < R)) {
return 1;
}
if (H[k] - D >= max(H[L], H[R])) {
return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
266 ms |
928 KB |
Output is correct |
2 |
Correct |
641 ms |
1448 KB |
Output is correct |
3 |
Correct |
789 ms |
1452 KB |
Output is correct |
4 |
Correct |
678 ms |
1420 KB |
Output is correct |
5 |
Correct |
421 ms |
1436 KB |
Output is correct |
6 |
Correct |
697 ms |
1360 KB |
Output is correct |
7 |
Correct |
603 ms |
1456 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
613 ms |
1448 KB |
1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
185 ms |
560 KB |
1st lines differ - on the 1st token, expected: '7197', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
266 ms |
928 KB |
Output is correct |
2 |
Correct |
641 ms |
1448 KB |
Output is correct |
3 |
Correct |
789 ms |
1452 KB |
Output is correct |
4 |
Correct |
678 ms |
1420 KB |
Output is correct |
5 |
Correct |
421 ms |
1436 KB |
Output is correct |
6 |
Correct |
697 ms |
1360 KB |
Output is correct |
7 |
Correct |
603 ms |
1456 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 ms |
208 KB |
Output is correct |
10 |
Correct |
0 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 |
- |