# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131387 | antimirage | Teams (IOI15_teams) | C++14 | 4093 ms | 10744 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>
#define fr first
#define sc second
using namespace std;
const int N = 1e5 + 5;
int cn[N], n;
pair <int, int> a[N];
void init(int N, int l[], int r[]) {
n = N;
for (int i = 0; i < n; i++) {
a[i] = {r[i], l[i]};
}
sort(a, a + n);
}
int can(int m, int k[]) {
sort(k, k + m);
int j = 0;
priority_queue <int> q;
for (int i = 0; i < m; i++) {
int cn = k[i];
while (j < n && cn > 0) {
while (j < n && a[j].fr < k[i])
j++;
q.push(-a[j].sc);
j++;
if (-q.top() <= k[i]) {
cn--;
q.pop();
}
}
if (j == n && cn > 0)
return false;
}
return true;
}
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... |