#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> h;
int k = 0;
void init(int N, std::vector<int> H) {
h = H;
for (k = 0; k < N - 1; k++)
{
if (h[k] > h[k + 1])
{
break;
}
}
}
int max_towers(int L, int R, int D) {
if (L < k && k < R && h[L] <= h[k] - D && h[k] - D >= h[R])
{
return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
326 ms |
924 KB |
Output is correct |
2 |
Correct |
799 ms |
1436 KB |
Output is correct |
3 |
Correct |
712 ms |
1516 KB |
Output is correct |
4 |
Correct |
586 ms |
1436 KB |
Output is correct |
5 |
Correct |
740 ms |
1352 KB |
Output is correct |
6 |
Correct |
721 ms |
1352 KB |
Output is correct |
7 |
Correct |
855 ms |
1464 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 |
480 ms |
1444 KB |
1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
252 ms |
560 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 |
326 ms |
924 KB |
Output is correct |
2 |
Correct |
799 ms |
1436 KB |
Output is correct |
3 |
Correct |
712 ms |
1516 KB |
Output is correct |
4 |
Correct |
586 ms |
1436 KB |
Output is correct |
5 |
Correct |
740 ms |
1352 KB |
Output is correct |
6 |
Correct |
721 ms |
1352 KB |
Output is correct |
7 |
Correct |
855 ms |
1464 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 |
- |