#include <bits/stdc++.h>
using namespace std;
int argmax;
vector<int> H;
void init(int N, vector<int> H) {
::H = H;
argmax = max_element(H.begin(), H.end()) - H.begin();
}
int max_towers(int L, int R, int D) {
if(L < argmax && argmax < R) {
if(H[argmax] - max(H[L], H[R]) >= D) return 2;
}
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
400 ms |
976 KB |
Output is correct |
2 |
Correct |
804 ms |
1356 KB |
Output is correct |
3 |
Correct |
743 ms |
1440 KB |
Output is correct |
4 |
Correct |
617 ms |
1352 KB |
Output is correct |
5 |
Correct |
677 ms |
1360 KB |
Output is correct |
6 |
Correct |
592 ms |
1360 KB |
Output is correct |
7 |
Correct |
781 ms |
1436 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 |
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 |
651 ms |
1456 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
233 ms |
556 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 |
400 ms |
976 KB |
Output is correct |
2 |
Correct |
804 ms |
1356 KB |
Output is correct |
3 |
Correct |
743 ms |
1440 KB |
Output is correct |
4 |
Correct |
617 ms |
1352 KB |
Output is correct |
5 |
Correct |
677 ms |
1360 KB |
Output is correct |
6 |
Correct |
592 ms |
1360 KB |
Output is correct |
7 |
Correct |
781 ms |
1436 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 |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |