Submission #204137

#TimeUsernameProblemLanguageResultExecution timeMemory
204137awlintqaaTeams (IOI15_teams)C++14
21 / 100
46 ms15224 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define C continue #define mem(dp,x) memset(dp,x,sizeof(dp)) typedef long long ll; typedef pair<int,int> pi; typedef pair<ll,ll>pll; #include "teams.h" int n; pi a[109]; int done[109]; void init(int N, int A[], int B[]) { n=N; for(int i =0 ;i < n;i ++ ){ a[i]={B[i],A[i]}; } sort(a,a+n); for(int i =0 ;i < n;i ++ ){ swap(a[i].fi,a[i].se); } } int can(int M, int K[]) { mem(done,0); sort(K,K+M); for(int i =0 ;i < M; i++) { int crnt=K[i]; for(int j =0 ;j <n;j++){ if ( done[j])C; if ( a[j].fi<=K[i] && a[j].se>=K[i]){ done[j]=1; crnt--; } if ( crnt==0)break; } if ( crnt > 0 )return 0; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...