제출 #69834

#제출 시각아이디문제언어결과실행 시간메모리
69834FedericoS마상시합 토너먼트 (IOI12_tournament)C++14
0 / 100
1067 ms2480 KiB
#include <iostream> #include <vector> #include <assert.h> using namespace std; typedef pair<int,int> pii; int RT[4000005]; vector<int> V; int a,b; pii ans,res; int converti(int k){ int res=0; for(int i=0;i<k+1;) if(RT[res++]) i++; return res-1; } void elimina(int x, int y){ for(int i=x;i<=y;i++) RT[i]=0; } int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { for(int i=0;i<400005;i++) RT[i]=1; for(int i=0;i<C;i++){ S[i]=converti(S[i]); E[i]=converti(E[i]+1); elimina(S[i]+1,E[i]-1); } for(int i=0;i<C;i++) for(int j=S[i];j<E[i]-1;j++) if(K[j]>R){ S[i]=E[i]=0; break; } for(int pos=0;pos<N;pos++){ for(int i=0;i<C;i++){ if(S[i]<=pos and pos<=E[i]-1) res.first++; } ans=max(ans,res); } return -ans.second; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...