#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int N, k;
vector<int> H;
void init(int n, vector<int> h) {
N = n;
H = h;
for(int i = 0; i < n-1; i++) {
if(h[i+1] < h[i]) {
k = i;
break;
}
}
}
int max_towers(int l, int r, int d) {
if(l < k && r > k && H[l] <= H[k]-d && H[r] <= H[k]-d)
return 2;
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
359 ms |
936 KB |
Output is correct |
2 |
Correct |
565 ms |
1360 KB |
Output is correct |
3 |
Correct |
987 ms |
1428 KB |
Output is correct |
4 |
Correct |
755 ms |
1352 KB |
Output is correct |
5 |
Correct |
819 ms |
1440 KB |
Output is correct |
6 |
Correct |
831 ms |
1352 KB |
Output is correct |
7 |
Correct |
913 ms |
1360 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
623 ms |
1356 KB |
1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
239 ms |
560 KB |
1st lines differ - on the 1st token, expected: '7197', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
359 ms |
936 KB |
Output is correct |
2 |
Correct |
565 ms |
1360 KB |
Output is correct |
3 |
Correct |
987 ms |
1428 KB |
Output is correct |
4 |
Correct |
755 ms |
1352 KB |
Output is correct |
5 |
Correct |
819 ms |
1440 KB |
Output is correct |
6 |
Correct |
831 ms |
1352 KB |
Output is correct |
7 |
Correct |
913 ms |
1360 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
11 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |