#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]++;
}
}
int max_towers(int L, int R, int D) {
return cs[R] - cs[L] + 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
378 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 |
668 ms |
1824 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 |
290 ms |
648 KB |
1st lines differ - on the 1st token, expected: '7197', found: '11952' |
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 |
378 ms |
1232 KB |
2nd lines differ - on the 1st token, expected: '1', found: '8351' |
2 |
Halted |
0 ms |
0 KB |
- |