제출 #1112790

#제출 시각아이디문제언어결과실행 시간메모리
1112790kojac마상시합 토너먼트 (IOI12_tournament)C++17
17 / 100
1059 ms2348 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll LINF = 0x3f3f3f3f3f3f3f3f; #define MAXN ((int)(3e5+2)) int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { int mx = -1, ans = 0; for(int i = 0; i <= N-1; i++){ vector<int> v; if(i == 0) v.push_back(R); for(int j = 0; j <= N-1; j++){ v.push_back(K[j]); if((int)v.size() == i) v.push_back(R); } int at = 0; for(int j = 0; j < C; j++){ vector<int> aux; int venc = 0; for(int x = 0; x < S[j]; x++) aux.push_back(v[x]); for(int x = S[j]; x <= E[j]; x++) venc = max(venc, v[x]); aux.push_back(venc); if(venc == R) at++; for(int x = E[j]+1; x < (int)v.size(); x++) aux.push_back(v[x]); v = aux; } if(at > mx){ mx = at; ans = i; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...