#include "towers.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
vector<int> H;
int N;
int K;
void init(int n, std::vector<int> h) {
H = h;
N = n;
int ma = -1;
int bes = -1;
for (int i=0; i<n; i++)
{
if (h[i] > ma)
{
ma = h[i];
bes = i;
}
}
K = bes;
}
int max_towers(int L, int R, int D) {
if ((L<K) and (K<R) and ((H[K]-H[L])>=D) and (((H[K]-H[R])>=D)))
return 2;
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
295 ms |
1112 KB |
Output is correct |
2 |
Correct |
673 ms |
1368 KB |
Output is correct |
3 |
Correct |
589 ms |
1368 KB |
Output is correct |
4 |
Correct |
585 ms |
1368 KB |
Output is correct |
5 |
Correct |
614 ms |
1368 KB |
Output is correct |
6 |
Correct |
640 ms |
1368 KB |
Output is correct |
7 |
Correct |
673 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
420 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
420 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
481 ms |
1368 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
169 ms |
692 KB |
1st lines differ - on the 1st token, expected: '7197', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
420 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
295 ms |
1112 KB |
Output is correct |
2 |
Correct |
673 ms |
1368 KB |
Output is correct |
3 |
Correct |
589 ms |
1368 KB |
Output is correct |
4 |
Correct |
585 ms |
1368 KB |
Output is correct |
5 |
Correct |
614 ms |
1368 KB |
Output is correct |
6 |
Correct |
640 ms |
1368 KB |
Output is correct |
7 |
Correct |
673 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
11 |
Incorrect |
0 ms |
420 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |