Submission #254283

#TimeUsernameProblemLanguageResultExecution timeMemory
254283eohomegrownappsTeams (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...