| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366291 | sodoo | Sequence (APIO23_sequence) | C++20 | 2095 ms | 4604 KiB |
#include "sequence.h"
#include<bits/stdc++.h>
using namespace std;
int sequence(int N,vector<int> A){
int mx=0;
for(int i=0;i<N;i++){
for(int j=i+1;j<N;j++){
vector<int> v;
for(int t=i;t<=j;t++){
v.push_back(A[t]);
}
sort(v.begin(),v.end());
int n=v.size();
int sumy=0,sumx=0,y=v[n/2],x=v[n/2-n%2];
for(int t=0;t<n;t++){
if(v[t]==y) sumy+=1;
if(v[t]==x) sumx+=1;
}
sumy=max(sumy,sumx);
mx=max(mx,sumy);
}
}
return mx;
}
/*int main(){
int rr;
vector<int> vv;
cin>>rr;
for(int i=1;i<=rr;i++){
int e;
cin>>e;
vv.push_back(e);
}
int ee=sequence(rr,vv);
cout<<ee;
}*/| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
