# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115516 | E869120 | 팀들 (IOI15_teams) | C++14 | 4014 ms | 21240 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int>G[1 << 17];
void init(int n, int A[], int B[]) {
N = n;
for (int i = 0; i < N; i++) G[A[i]].push_back(B[i]);
}
int can(int M, int K[]) {
priority_queue<int, vector<int>, greater<int>>Q;
sort(K, K + M); int cx = 0;
for (int i = 0; i < M; i++) {
for (int j = cx + 1; j <= K[i]; j++) {
for (int k = 0; k < G[j].size(); k++) Q.push(G[j][k]);
}
while (!Q.empty()) { int pos = Q.top(); if (pos < K[i]) Q.pop(); else break; }
for (int j = 0; j < K[i]; j++) {
if (Q.empty()) return 0;
Q.pop();
}
cx = K[i];
}
return 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |