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