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;
vector<int> H;
int N;
int K;
void init(int n, std::vector<int> h) {
H = h;
N = n;
int ma = -1;
int bes = -1;
for (int i=0; i<n; i++)
{
if (h[i] > ma)
{
ma = h[i];
bes = i;
}
}
K = bes;
}
int max_towers(int L, int R, int D) {
if ((L<K) and (K<R) and ((H[K]-H[L])>=D) and (((H[K]-H[R])>=D)))
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... |