제출 #981934

#제출 시각아이디문제언어결과실행 시간메모리
981934vjudge1서열 (APIO23_sequence)C++17
11 / 100
35 ms4200 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...