#include "towers.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
namespace
{
int N;
vector<int> H, s;
}
void init(int _N, vector<int> _H)
{
H = _H;
N = _N;
s.resize(N);
for (int i = 1; i + 1 < N; i++)
s[i] = (H[i - 1] < H[i] && H[i] > H[i + 1]);
for (int i = 1; i < N; i++)
s[i] += s[i - 1];
}
int max_towers(int L, int R, int D)
{
if(R - L <= 1)
return 1;
return max(1, s[R - 1] - s[L]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
299 ms |
1232 KB |
12th lines differ - on the 1st token, expected: '2', 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: '15' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '15' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
454 ms |
1824 KB |
1st lines differ - on the 1st token, expected: '11903', found: '11902' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
175 ms |
644 KB |
1st lines differ - on the 1st token, expected: '7197', found: '8003' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '15' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
299 ms |
1232 KB |
12th lines differ - on the 1st token, expected: '2', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |