Submission #129229

#TimeUsernameProblemLanguageResultExecution timeMemory
129229joseacazTeams (IOI15_teams)C++17
34 / 100
4027 ms12228 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; int N; vector < pii > S; void init ( int _n, int _a[], int _b[] ) { N = _n; for ( int i = 0; i < N; i++ ) S.push_back ( {_a[i], _b[i]} ); sort ( S.begin(), S.end() ); } priority_queue < int > PQ; int can ( int M, int K[] ) { int cnt = 0, tmp; while ( !PQ.empty() ) PQ.pop(); sort ( K, K + M ); for ( int i = 0; i < M; i++ ) { for ( ; S[cnt].first <= K[i] && cnt < N; cnt++ ) PQ.push ( -S[cnt].second ); tmp = 0; while ( tmp < K[i] && !PQ.empty() ) { if ( -PQ.top() >= K[i] ) tmp++; PQ.pop(); } if ( tmp < 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...