제출 #254283

#제출 시각아이디문제언어결과실행 시간메모리
254283eohomegrownapps팀들 (IOI15_teams)C++14
0 / 100
4075 ms12592 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; vector<pair<int,int>> ranges; int n; void init(int N, int A[], int B[]) { n=N; ranges.resize(n); for (int i=0; i<n; i++){ ranges[i].first=A[i]; ranges[i].second=B[i]; } sort(ranges.begin(),ranges.end()); } int can(int m, int k[]) { sort(k,k+m); int ptr = 0; priority_queue<int,vector<int>,greater<int>> pq; for (int i = 0; i<m; i++){ for (int j = 0; j<k[i]; j++){ while (ptr<n&&ranges[ptr].first<=k[i]){ pq.push(ranges[ptr].second); ptr++; } if (pq.size()==0||pq.top()<k[i]){ 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...