This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
ll k,h[100005];
void init(int N, std::vector<int> H) {
for (int i=0;i<N;i++) {
h[i] = H[i];
if (i>0 && i<N-1 && H[i] > H[i-1] && H[i] > H[i+1]) k = i;
}
return;
}
int max_towers(int L, int R, int D) {
if (L > k || k > R) return 1;
if (h[L] <= h[k]-D && h[R] <= h[k]-D) return 2;
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... |