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 maxi=-1;
vector<int> *h;
void init(int n, vector<int> _h) {
h=&_h;
maxi=max_element((*h).begin(),(*h).end())-(*h).begin();
}
int max_towers(int l, int r, int d) {
if(l<maxi && maxi<r){
if((*h)[l]+d<=(*h)[maxi] && (*h)[r]+d<=(*h)[maxi]) return 2;
else return 1;
}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... |