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<bits/stdc++.h>
#include "towers.h"
#include <vector>
using namespace std;
int idx = -1;
vector<int>v;
void init(int N, std::vector<int> H) {
for (int i = 1; i < N - 1; i++)
if (H[i] > H[i - 1] && H[i] > H[i + 1])
idx = i;
v = H;
}
int max_towers(int L, int R, int D) {
if (R <= idx || L >= idx || v[idx] - v[L] < D || v[idx] - v[R] < D)
return 1;
return 2;
}
# | 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... |