제출 #727630

#제출 시각아이디문제언어결과실행 시간메모리
727630mgl_diamond팀들 (IOI15_teams)C++14
0 / 100
4041 ms28120 KiB
#include <bits/stdc++.h> #define all(x) (x).begin(),(x).end() #define sz(x) (int)(x).size() #define C make_pair #define vec vector #define ins push_back #define fi first #define se second using namespace std; using ll = long long; using ii = pair<int, int>; int n; multiset<ii> avail; void init(int N, int A[], int B[]) { n = N; for(int i=0; i<n; ++i) avail.insert({A[i], B[i]}); } bool can(int M, int K[]) { sort(K, K+M); for(int i=0; i<M; ++i) { vec<ii> cands; for(auto x : avail) if (x.fi <= K[i] && x.se >= K[i]) cands.emplace_back(x.se, x.fi); if (K[i] > sz(cands)) return 0; sort(all(cands)); for(int j=0; j<K[i]; ++j) avail.erase(avail.find({cands[j].se, cands[j].fi})); } 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...