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;
int mxPos = -1;
int mx = -1;
vector<int> h;
void init(int N, std::vector<int> H) {
for (int i=0;i<N;i++) {
if (H[i] > mx) {
mx = H[i];
mxPos = i;
}
}
h = H;
}
int max_towers(int L, int R, int D) {
if (L >= mxPos || R <= mxPos) return 0;
if (mx - D < max(h[L], h[R])) return 0;
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... |