Submission #186187

#TimeUsernameProblemLanguageResultExecution timeMemory
186187TAISA_Teams (IOI15_teams)C++14
0 / 100
4094 ms8980 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; using P=pair<int,int>; vector<P> v; int n; void init(int N, int A[], int B[]) { for(int i=0;i<N;i++){ v.emplace_back(A[i],B[i]); } n=N; sort(v.begin(),v.end()); } int can(int M, int K[]) { sort(K,K+M); vector<int> deg(M); int id=0; for(int i=0;i<n;i++){ while(id<M&&deg[id]==K[id]){ id++; } if(id==M){ return 1; } if(v[i].first>K[id]){ return 0; } if(v[i].first<=K[id]&&K[id]<=v[i].second){ deg[id]++; } } while(id<M&&deg[id]==K[id]){ id++; } return (id==M); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...