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>
int iMaxi = 0, maxi = 0;
std::vector<int> hauteurs;
void init(int N, std::vector<int> H)
{
for (int i = 0; i < N; i++)
{
if(H[i] >= maxi)
{
iMaxi = i;
maxi = H[i];
}
}
hauteurs = H;
}
int max_towers(int L, int R, int D)
{
if (L < iMaxi && R > iMaxi && maxi - D >= hauteurs[L] && maxi - D >= hauteurs[R])
{
return 2;
}
return 0;
}
# | 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... |