Submission #1117994

#TimeUsernameProblemLanguageResultExecution timeMemory
1117994LuvidiTeams (IOI15_teams)C++17
34 / 100
4058 ms19044 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; int n; const int maxn=5e5; pair<int,int> a[maxn+1]; 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); } int can(int m, int k[]) { sort(k,k+m); int idx=0; priority_queue<int> pq; for(int i=0;i<m;i++){ int x=k[i]; while(idx<n&&a[idx].first<=x){ pq.push(-a[idx].second); idx++; } while(!pq.empty()&&-pq.top()<x)pq.pop(); while(x--){ if(pq.empty())return 0; pq.pop(); } } 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...