Submission #922060

#TimeUsernameProblemLanguageResultExecution timeMemory
922060coding_snorlaxTeams (IOI15_teams)C++14
34 / 100
4026 ms13516 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; #define pb push_back vector<int> List[100005]; int Req[100005]={0}; multiset<int> in_queue; int n; void init(int N, int A[], int B[]) { n=N; for(int i=0;i<N;i++) List[A[i]].push_back(B[i]); } int can(int M, int K[]) { for(int i=0;i<=n;i++) Req[i]=0; in_queue.clear(); for(int i=0;i<M;i++){ Req[K[i]]+=K[i]; } for(int i=1;i<=n;i++){ for(int j:List[i]) in_queue.insert(j); while(Req[i]){ if(in_queue.size()) in_queue.erase(in_queue.begin()); else return 0; Req[i]--; } in_queue.erase(i); } 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...