제출 #946079

#제출 시각아이디문제언어결과실행 시간메모리
946079thelegendary08마상시합 토너먼트 (IOI12_tournament)C++14
0 / 100
48 ms2820 KiB
#include<bits/stdc++.h> using namespace std; int GetBestPosition(int N, int C, int R, int *K, int *S, int *E){ //cout<<K[0]; vector<int>v; for(int i = 0;i<N-1;i++)v.push_back(K[i]); int ans = 0; for(int i = 0;i<N;i++){ int cur = 0; vector<int>w = v; if(i != N-1)w.insert(w.begin() + i, R); else w.insert(w.end(), R); for(int j = 0;j<C;j++){ int mx = *max_element(w.begin() + S[j], w.begin() + E[j] + 1); if(mx == R)cur++; for(int k = S[j];k<=E[j];k++){ if(w[k] != mx)w.erase(w.begin() + k); } } ans = max(ans, cur); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...