제출 #419878

#제출 시각아이디문제언어결과실행 시간메모리
419878SeDunion팀들 (IOI15_teams)C++17
34 / 100
4059 ms27056 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; int N; vector<int>add[(int)5e5+11]; void init(int N_, int A[], int B[]) { N = N_; for (int i = 0 ; i < N ; ++ i) add[A[i]].emplace_back(B[i]); } priority_queue<int, vector<int>, greater<int>>pq; int can(int M, int K[]) { sort(K, K + M); while (pq.size()) pq.pop(); int L = 0; for (int i = 0 ; i < M ; ++ i) { while (L <= K[i]) { for (int val : add[L]) { pq.push(val); } L++; } int mine = K[i]; while (pq.size() && mine) { int x = pq.top(); pq.pop(); if (x >= K[i]) mine--; } if (mine) 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...