Submission #744220

#TimeUsernameProblemLanguageResultExecution timeMemory
744220vjudge1Teams (IOI15_teams)C++17
34 / 100
4066 ms16612 KiB
#include <bits/stdc++.h> using namespace std; int n; pair<int, int> a[100000]; void init(int N, int A[], int B[]) { n=N; for (int i=0; i<n; i++) a[i]={A[i], B[i]}; sort(a, a+n); return; } bool can(int m, int p[]) { sort(p, p+m); priority_queue<int> pq; int j=0; for (int i=0; i<m; i++) { for (; j<n; j++) { if (a[j].first>p[i]) break; pq.push(-a[j].second); } int k=0; while (k<p[i]) { if (pq.empty()) return false; int x=-pq.top(); pq.pop(); if (x<p[i]) continue; k=k+1; } } return true; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...