# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131383 | antimirage | Teams (IOI15_teams) | C++14 | 4011 ms | 19968 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;
const int N = 1e5 + 5;
vector <int> R[N];
int cn[N], n;
void init(int N, int l[], int r[]) {
n = N;
for (int i = 0; i < n; i++) {
R[r[i]].push_back(l[i]);
}
}
int can(int m, int k[]) {
priority_queue <int> q;
sort(k, k + m);
for (int i = 0; i < m; i++) {
cn[i] = k[i];
}
int j = 0;
for (int i = 1; i <= n; i++) {
for (auto it : R[i])
q.push(-it);
while (j < m && i >= j && !q.empty() && -q.top() <= k[j]) {
cn[j]--;
q.pop();
if (cn[j] == 0) j++;
}
}
return j == m;
}
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... |