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;
const int INF = 1 << 30;
int N;
vector<int> H;
int K = 0;
void init(int N_, vector<int> H_)
{
N = N_;
H = H_;
int mx = 0;
for (int i = 0; i < N; i++)
{
if (H[i] > mx)
{
mx = H[i];
K = i;
}
}
}
int max_towers(int L, int R, int D)
{
if (L < K && K < R)
{
if (H[K] - max(H[L], H[R]) >= D)
return 2;
return 1;
}
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... |