#include "towers.h"
#include <vector>
int ans = 1;
int k = -1;
void init(int N, std::vector<int> H) {
if (N == 1) return;
if (N == 2) return;
if (H[0] > H[1] || H[N - 2] < H[N - 1]) return;
for (int i = 0; i < N; i++) {
if (H[i] > H[i + 1]) {
k = i;
break;
}
}
return;
}
int max_towers(int L, int R, int D) {
if (k == -1) return 1;
if (R - L + 1 < 3) return 1;
if (L < k && k < R) return 3;
else return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |