#include<bits/stdc++.h>
#include "towers.h"
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,f[100009],K,pas,L,R,D;
void init(int NN, std::vector<int> HH) {
a=NN;
for(i=1; i<=a; i++){
f[i]=HH[i-1];
}
K=1;
for(i=1; i<=a; i++){
if(f[K]<f[i]) K=i;
}
}
int max_towers(int LL, int RR, int DD) {
pas=1;LL++;RR++;
L=LL;R=RR;D=DD;
if(L<K&&K<R){
if(max(f[L],f[R])<=f[K]-D){
pas=2;
}
}
return pas;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
362 ms |
976 KB |
Output is correct |
2 |
Correct |
725 ms |
1448 KB |
Output is correct |
3 |
Correct |
511 ms |
1488 KB |
Output is correct |
4 |
Correct |
455 ms |
1360 KB |
Output is correct |
5 |
Correct |
763 ms |
1352 KB |
Output is correct |
6 |
Correct |
638 ms |
1448 KB |
Output is correct |
7 |
Correct |
531 ms |
1452 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 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 |
465 ms |
1448 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
202 ms |
464 KB |
1st lines differ - on the 1st token, expected: '7197', found: '2' |
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 |
362 ms |
976 KB |
Output is correct |
2 |
Correct |
725 ms |
1448 KB |
Output is correct |
3 |
Correct |
511 ms |
1488 KB |
Output is correct |
4 |
Correct |
455 ms |
1360 KB |
Output is correct |
5 |
Correct |
763 ms |
1352 KB |
Output is correct |
6 |
Correct |
638 ms |
1448 KB |
Output is correct |
7 |
Correct |
531 ms |
1452 KB |
Output is correct |
8 |
Correct |
0 ms |
208 KB |
Output is correct |
9 |
Correct |
1 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 |
- |