#include "towers.h"
#include<bits/stdc++.h>
using namespace std;
int Max_place=0;
int Now;
vector<int> S;
void init(int N,vector<int> H){
Now=H[0];
for(int i=1;i<N;i++){
if(H[i]>H[i-1]){
Max_place++;
Now=H[i];
}
}
for(int i=0;i<N;i++){
S.push_back(H[i]);
}
}
int max_towers(int L,int R,int D){
if(L<Max_place && Max_place<R){
if(S[L]+D<=Now && S[R]+D<=Now) return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
428 ms |
1028 KB |
Output is correct |
2 |
Correct |
835 ms |
1688 KB |
Output is correct |
3 |
Correct |
790 ms |
1692 KB |
Output is correct |
4 |
Correct |
899 ms |
1688 KB |
Output is correct |
5 |
Correct |
883 ms |
1604 KB |
Output is correct |
6 |
Correct |
828 ms |
1672 KB |
Output is correct |
7 |
Correct |
913 ms |
1604 KB |
Output is correct |
8 |
Correct |
1 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 |
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 |
616 ms |
1688 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
196 ms |
676 KB |
1st lines differ - on the 1st token, expected: '7197', found: '2' |
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 |
428 ms |
1028 KB |
Output is correct |
2 |
Correct |
835 ms |
1688 KB |
Output is correct |
3 |
Correct |
790 ms |
1692 KB |
Output is correct |
4 |
Correct |
899 ms |
1688 KB |
Output is correct |
5 |
Correct |
883 ms |
1604 KB |
Output is correct |
6 |
Correct |
828 ms |
1672 KB |
Output is correct |
7 |
Correct |
913 ms |
1604 KB |
Output is correct |
8 |
Correct |
1 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 |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |