Submission #1034459

#TimeUsernameProblemLanguageResultExecution timeMemory
1034459vjudge1Teams (IOI15_teams)C++17
0 / 100
4043 ms16808 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; int n,*a,*b; int p[200000]; void init(int N, int A[], int B[]) { n=N,a=A,b=B; for(int i=0;i<n;i++){ p[i]=i; } sort(p,p+n,[&](int i,int j)->bool { return a[i]<a[j]; }); } int can(int M, int K[]) { priority_queue<int,vector<int>,greater<int>>pq; int j=0; for(int i=0;i<M;i++){ while(j<n&&a[p[j]]<=K[i]){ pq.push(b[p[j]]); j++; } while(pq.size()&&pq.top()<K[i])pq.pop(); while(K[i]&&pq.size()){ K[i]--; pq.pop(); } if(K[i])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...