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>
using namespace std;
int sequence(int n, vector<int> a) {
int ans = 0;
for (int i = 0; i < n; ++i) {
vector<int> b;
map<int, int> mp;
for (int j = i; j < n; ++j) {
b.push_back(a[j]);
mp[a[j]]++;
sort(b.begin(), b.end());
int d = b[b.size() / 2], d2 = b[(b.size() + 1) / 2];
ans = max({ans, mp[d], mp[d2]});
}
}
return ans;
}
//int main() {
// int n;
// cin >> n;
// vector<int> a(n);
// for (int i = 0; i < n; ++i)
// cin >> a[i];
// cout << sequence(n, a);
// 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... |