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 "sequence.h"
#include <bits/stdc++.h>
using namespace std;
int techo(int k)
{
if (k % 2 == 0)
{
return k /2;
}
return (k/2) + 1;
}
int sequence(int N, std::vector<int> A)
{
int maxV = -1;
for (int i = 0; i < N-1; i++)
{
for (int j = i + 1; j < N; i++)
{
vector <int> arr;
for (int k = i; k <= j; k++)
{
arr.push_back(A[k]);
}
sort(arr.begin(), arr.end());
int p = arr.size()/2;
int t = techo(arr.size());
maxV = max(maxV, max(arr[p], arr[t]));
}
}
return maxV;
}
# | 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... |