#include <bits/stdc++.h>
#include "towers.h"
using namespace std;
int k;
vector<int> h;
void init(int n, vector<int> H) {
h = H;
k = 0;
while (k + 1 < n and h[k] < h[k + 1])
k++;
}
int max_towers(int L, int R, int D) {
return 1 + (L < k and k < R and h[R] + D <= h[k] and h[L] + D <= h[k]);
}
# | 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... |