#include<bits/stdc++.h>
#include "towers.h"
#include <vector>
using namespace std;
vector<int>v, cs;
void init(int N, std::vector<int> H) {
v = H;
cs.resize(N);
cs[0] = 1;
for (int i = 0; i < N - 1; i++) {
cs[i + 1] = cs[i];
if (v[i] > v[i + 1])
cs[i + 1]++;
}
cs[N - 1] = cs[N - 2];
}
int max_towers(int L, int R, int D) {
return cs[R] - cs[L] + 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
418 ms |
1232 KB |
2nd lines differ - on the 1st token, expected: '1', found: '8351' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '26' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '26' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
506 ms |
1828 KB |
1st lines differ - on the 1st token, expected: '11903', found: '18073' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
283 ms |
648 KB |
1st lines differ - on the 1st token, expected: '7197', found: '11951' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
1st lines differ - on the 1st token, expected: '13', found: '26' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
418 ms |
1232 KB |
2nd lines differ - on the 1st token, expected: '1', found: '8351' |
2 |
Halted |
0 ms |
0 KB |
- |