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"
using namespace std;
int sequence(int n, vector<int> A)
{
int ans = 1;
for (int i = 0; i < n; i++)
{
vector<int> cur;
map<int, int> mp;
for (int j = i; j < n; j++)
{
cur.push_back(A[j]);
mp[A[j]]++;
sort(cur.begin(), cur.end());
ans = max(ans, mp[cur[(j - i) / 2]]);
ans = max(ans, mp[cur[(j - i + 1) / 2]]);
}
}
return ans;
}
# | 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... |