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 n,k;
vector<int> h;
void init(int N, vector<int> H) {
n=N; h=H;
for(int i=1;i<n-1;i++)
if(h[i-1]<h[i] && h[i]>h[i+1]) k=i;
}
int max_towers(int l, int r, int d){
if(l<k && k<r){
if(h[l]<=h[k]-d && h[r]<=h[k]-d) 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... |