Submission #186269

#TimeUsernameProblemLanguageResultExecution timeMemory
186269TAISA_Teams (IOI15_teams)C++14
34 / 100
4070 ms16228 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); int id=0; priority_queue<P,vector<P>,greater<P>> q; for(int i=0;i<M;i++){ while(id<n&&v[id].first<=K[i]){ q.push(P(v[id].second,v[id].first)); id++; } int cnt=K[i]; while(!q.empty()&&cnt>0){ if(q.top().first<K[i]){ q.pop(); continue; } cnt--; q.pop(); } if(cnt>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...