Submission #262227

#TimeUsernameProblemLanguageResultExecution timeMemory
262227amiratouTeams (IOI15_teams)C++14
34 / 100
4077 ms38416 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long #define fi first #define se second #define sz(x) (int)(x.size()) vector<pair<int,int> > vec; void init(int N, int A[], int B[]) { vec.resize(N); for (int i = 0; i < N; ++i) vec[i]={A[i],B[i]}; sort(vec.begin(),vec.end()); } int can(int M, int K[]) { sort(K,K+M); multiset<int> myset; int idx=0; for (int i = 0; i < M; ++i) { while(idx<sz(vec) && vec[idx].fi<=K[i]) myset.insert(vec[idx].se),idx++; while(sz(myset)&&((*myset.begin())<K[i])) myset.erase(myset.begin()); if(sz(myset)<K[i])return 0; for (int j = 0; j < K[i]; ++j) myset.erase(myset.begin()); } 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...