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 <vector>
#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5+10;
int mx;
int N;
vector<int> H;
void init(int NN, std::vector<int> HH) {
H = HH;
N = NN;
mx = max_element(H.begin(),H.end())-H.begin();
return;
}
int max_towers(int L, int R, int D) {
if(L>=mx||mx>=R)return 1;
else if(min(H[mx]-H[L],H[mx]-H[R])<D)return 1;
else 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... |