Submission #1034335

#TimeUsernameProblemLanguageResultExecution timeMemory
1034335ZicrusTeams (IOI15_teams)C++17
34 / 100
4083 ms20308 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; typedef long long ll; ll n; vector<pair<ll, ll>> a; void init(int n1, int a1[], int b1[]) { n = n1; a = vector<pair<ll, ll>>(n); for (int i = 0; i < n; i++) { a[i].first = a1[i]; a[i].second = b1[i]; } sort(a.begin(), a.end()); reverse(a.begin(), a.end()); } int can(int m, int k[]) { vector<ll> q(m); for (int i = 0; i < m; i++) q[i] = k[i]; sort(q.begin(), q.end()); reverse(q.begin(), q.end()); vector<bool> used(n); for (auto &e : q) { ll cnt = e; for (int i = 0; i < n && cnt; i++) { if (used[i]) continue; pair<ll, ll> &s = a[i]; if (s.first > e) { used[i] = true; continue; } if (s.second >= e) { used[i] = true; cnt--; } } if (cnt) 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...