#include "towers.h"
#include <vector>
int iMaxi = 0, maxi = 0;
std::vector<int> hauteurs;
void init(int N, std::vector<int> H)
{
for (int i = 0; i < N; i++)
{
if(H[i] >= maxi)
{
iMaxi = i;
maxi = H[i];
}
}
hauteurs = H;
}
int max_towers(int L, int R, int D)
{
if (L < iMaxi && R > iMaxi && maxi - D >= hauteurs[L] && maxi - D >= hauteurs[R])
{
return 2;
}
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
274 ms |
1112 KB |
Output is correct |
2 |
Correct |
558 ms |
1368 KB |
Output is correct |
3 |
Correct |
554 ms |
1368 KB |
Output is correct |
4 |
Correct |
587 ms |
1588 KB |
Output is correct |
5 |
Correct |
632 ms |
1368 KB |
Output is correct |
6 |
Correct |
591 ms |
1368 KB |
Output is correct |
7 |
Correct |
594 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
340 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
457 ms |
1368 KB |
1st lines differ - on the 1st token, expected: '11903', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
199 ms |
672 KB |
1st lines differ - on the 1st token, expected: '7197', found: '2' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
274 ms |
1112 KB |
Output is correct |
2 |
Correct |
558 ms |
1368 KB |
Output is correct |
3 |
Correct |
554 ms |
1368 KB |
Output is correct |
4 |
Correct |
587 ms |
1588 KB |
Output is correct |
5 |
Correct |
632 ms |
1368 KB |
Output is correct |
6 |
Correct |
591 ms |
1368 KB |
Output is correct |
7 |
Correct |
594 ms |
1368 KB |
Output is correct |
8 |
Correct |
0 ms |
340 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 |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '1' |
12 |
Halted |
0 ms |
0 KB |
- |