Submission #982142

#TimeUsernameProblemLanguageResultExecution timeMemory
982142sopaconkSequence (APIO23_sequence)C++17
11 / 100
2062 ms5000 KiB
#include "sequence.h" #include <vector> #include<bits/stdc++.h> using namespace std; #define pb push_back int sequence(int N, vector<int> A) { int ans=0; for(int i=0; i<N; ++i){ for(int j=i; j<N; ++j){ vector<int> aux; for(int x=i; x<=j; ++x){ aux.pb(A[x]); } sort(aux.begin(), aux.end()); int median=aux[(aux.size()-1)/2]; int help=0; for(int x: aux){ if(x==median){ help++; } } ans=max(ans, help); median=aux[(aux.size()+1)/2]; help=0; for(int x: aux){ if(x==median){ help++; } } ans=max(ans, help); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...