#include "towers.h"
#include <vector>
using namespace std;
const int N = 100000;
typedef vector<int> vi;
int aa[N], i;
void init(int n, vi aa_) {
for (i = 0; i < n; i++)
aa[i] = aa_[i];
i = 0;
while (i < n - 1 && aa[i] < aa[i + 1])
i++;
}
int max_towers(int l, int r, int d) {
return l < i && i < r && aa[i] - aa[l] >= d && aa[i] - aa[r] >= d ? 2 : 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
227 ms |
920 KB |
Output is correct |
2 |
Correct |
854 ms |
1332 KB |
Output is correct |
3 |
Correct |
719 ms |
1320 KB |
Output is correct |
4 |
Correct |
826 ms |
1324 KB |
Output is correct |
5 |
Correct |
542 ms |
1352 KB |
Output is correct |
6 |
Correct |
851 ms |
1360 KB |
Output is correct |
7 |
Correct |
881 ms |
1420 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
581 ms |
1432 KB |
1st lines differ - on the 1st token, expected: '11903', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
269 ms |
544 KB |
1st lines differ - on the 1st token, expected: '7197', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
227 ms |
920 KB |
Output is correct |
2 |
Correct |
854 ms |
1332 KB |
Output is correct |
3 |
Correct |
719 ms |
1320 KB |
Output is correct |
4 |
Correct |
826 ms |
1324 KB |
Output is correct |
5 |
Correct |
542 ms |
1352 KB |
Output is correct |
6 |
Correct |
851 ms |
1360 KB |
Output is correct |
7 |
Correct |
881 ms |
1420 KB |
Output is correct |
8 |
Correct |
1 ms |
208 KB |
Output is correct |
9 |
Correct |
1 ms |
208 KB |
Output is correct |
10 |
Correct |
0 ms |
208 KB |
Output is correct |
11 |
Incorrect |
1 ms |
212 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |