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 <bits/stdc++.h>
#include "sequence.h"
// #include "grader.cpp"
using namespace std;
#define sz(v) (int)(v).size()
int sequence(int n, vector<int> a) {
int mx = 0;
for (int i = 0; i < n; i++) {
vector<int> v;
for (int j = i; j < n; j++) {
v.push_back(a[j]);
vector<int> u = v;
sort(u.begin(), u.end());
for (auto x : {((sz(u) - 1) >> 1), (sz(u) >> 1)}) {
mx = max(mx, (int)count(u.begin(), u.end(), u[x]));
}
}
}
return mx;
}
# | 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... |