Submission #1121059

#TimeUsernameProblemLanguageResultExecution timeMemory
1121059epicci23Teams (IOI15_teams)C++17
34 / 100
4094 ms38380 KiB
#include "bits/stdc++.h" #include "teams.h" #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; vector<array<int,2>> v; int n; void init(int N, int A[], int B[]){ n = N; for(int i = 0 ; i < n ; i++) v.push_back({A[i], B[i]}); sort(all(v)); } int can(int M, int K[]){ sort(K,K+M); multiset<int> ms; int p = 0; for(int i = 0 ; i < M ; i++){ int val = K[i]; while(p < n && v[p][0] <= val) ms.insert(v[p++][1]); while(!ms.empty() && val){ auto it = ms.lower_bound(K[i]); if(it == ms.end()) break; val--; ms.erase(ms.find(*it)); } if(val) 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...