제출 #91634

#제출 시각아이디문제언어결과실행 시간메모리
91634KLPP팀들 (IOI15_teams)C++14
34 / 100
4027 ms12532 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; /* 4 2 4 1 2 2 3 2 3 2 2 1 3 2 1 1 */ pair<int,int> arr[1000000]; int n; void init(int N, int A[], int B[]) { n=N; for(int i=0;i<n;i++)arr[i]=pii(A[i],B[i]); sort(arr,arr+n); } int can(int M, int K[]) { sort(K,K+M); int pnt=0; priority_queue<int>pq; for(int i=0;i<M;i++){ while(pnt<n && arr[pnt].first<=K[i]){ pq.push(-arr[pnt].second); pnt++; } while(-pq.top()<K[i]){ if(pq.empty())return 0; pq.pop(); } for(int j=0;j<K[i];j++){ 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...