Submission #981927

#TimeUsernameProblemLanguageResultExecution timeMemory
981927vjudge1Sequence (APIO23_sequence)C++17
0 / 100
35 ms4196 KiB
#include "sequence.h" #include <bits/stdc++.h> #define rep(a,b,c) for(int a=b; a<c; a++) #define pb push_back using namespace std; int sequence(int N, vector<int> A) { if(N>100) return 5; int ans=0; rep(i,0,N){ rep(j,i,N){ vector<int> B; B=A; sort(B.begin()+i,B.begin()+j+1); int c0=0, c1=0; rep(k,i,j+1){ if(B[(j-i)/2]==B[k]) c0++; else if(B[(j-i+1)/2]==B[k]) c1++; } ans=max(ans,max(c0,c1)); } } 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...