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 k=INT_MAX, n;
vector<int> h;
void init(int tempn, vector<int> temph) {
n=tempn;
h=temph;
for (int i = 1; i < n; ++i)
{
if (temph[i]>temph[i+1])
{
k=i;
return;
}
}
return;
}
int max_towers(int L, int R, int D) {
if (k<L || k>R || h[k]-D<max(h[L], h[R])) return 1;
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... |