Submission #673621

#TimeUsernameProblemLanguageResultExecution timeMemory
673621jamezzzTeams (IOI15_teams)C++17
34 / 100
4066 ms12156 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; #define fi first #define se second #define pb push_back #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() vector<ii> v; void init(int N,int A[],int B[]){ for(int i=0;i<N;++i){ v.pb({A[i],B[i]}); } sort(all(v)); } int can(int M,int K[]){ priority_queue<int,vector<int>,greater<int>> pq; sort(K,K+M); int ptr=0,n=sz(v); for(int i=0;i<M;++i){ while(ptr<n&&v[ptr].fi<=K[i]){ pq.push(v[ptr++].se); } while(!pq.empty()&&pq.top()<K[i])pq.pop(); if(sz(pq)<K[i])return 0; for(int j=0;j<K[i];++j)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...