#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int k=0;
vector<int> a;
int n;
void init(int N, vector<int> h) {
a=h;
n=N;
while (k<n-1 && a[k]<a[k+1]) ++k;
}
int max_towers(int L, int R, int d) {
if (L>=k || R<=k) return 1;
if (a[L]>a[k]-d || a[R]>a[k]-d) return 1;
return 2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
191 ms |
976 KB |
Output is correct |
2 |
Correct |
841 ms |
1456 KB |
Output is correct |
3 |
Correct |
775 ms |
1436 KB |
Output is correct |
4 |
Correct |
777 ms |
1360 KB |
Output is correct |
5 |
Correct |
885 ms |
1352 KB |
Output is correct |
6 |
Correct |
657 ms |
1352 KB |
Output is correct |
7 |
Correct |
692 ms |
1436 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 ms |
208 KB |
Output is correct |
10 |
Correct |
1 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 |
483 ms |
1452 KB |
1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
263 ms |
556 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 |
191 ms |
976 KB |
Output is correct |
2 |
Correct |
841 ms |
1456 KB |
Output is correct |
3 |
Correct |
775 ms |
1436 KB |
Output is correct |
4 |
Correct |
777 ms |
1360 KB |
Output is correct |
5 |
Correct |
885 ms |
1352 KB |
Output is correct |
6 |
Correct |
657 ms |
1352 KB |
Output is correct |
7 |
Correct |
692 ms |
1436 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
0 ms |
208 KB |
Output is correct |
10 |
Correct |
1 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 |
- |