#include <vector>
#include <algorithm>
using namespace std;
int sequence(const int n,const vector<int> arr){
int ans = 0;
for (int l = 0;l<n;l++){
for (int r = l+1;r<n;r++){
vector<int> data(r-l+1);
for (int i = l;i<=r;i++){
data[i-l]=arr[l];
}
sort(data.begin(),data.end());
int s = r-l+1;
int mid1 = data[s/2];
int mid2 = data[(s-1)/2];
ans = max((int)count(data.begin(),data.end(),mid1),ans);
ans = max((int)count(data.begin(),data.end(),mid2),ans);
}
}
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... |