#include "towers.h"
#include<bits/stdc++.h>
using namespace std;
int sommet;
vector<int> altitudes;
void init(int N, vector<int> H) {
altitudes = H;
int hcur = 0;
int pos = 0;
while(H[pos] > hcur){
hcur = H[pos];
pos++;
}
sommet = pos-1;
cout << sommet << endl;
}
int max_towers(int L, int R, int D) {
if(L==R)
return 1;
if(L<=sommet && R<=sommet)
return 1;
if(L>=sommet && R>=sommet)
return 1;
if(altitudes[sommet] - max(altitudes[L], altitudes[R]) < D)
return 1;
return 2;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
1112 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
1368 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
600 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
1112 KB |
Possible tampering with the output or unexpected termination of the program |
2 |
Halted |
0 ms |
0 KB |
- |