#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 |
1 |
Execution timed out |
2017 ms |
412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2017 ms |
412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2017 ms |
412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2032 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2035 ms |
4188 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2017 ms |
412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2017 ms |
412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |