# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578711 | georgievskiy | Teams (IOI15_teams) | C++14 | 4037 ms | 26188 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 = 2e5;
int a[N], b[N];
int n;
void init(int N, int A[], int B[]) {
n = N;
vector<pair<int, int>> t(n);
for (int i = 0; i < n; i++) t[i] = {B[i], A[i]};
sort(t.begin(), t.end());
for (int i = 0; i < n; i++) a[i] = t[i].second, b[i] = t[i].first;
}
int can(int m, int k[]) {
sort(k, k + m);
int p = 0;
for (int i = 0; i < m; i++) {
int x = k[i];
while (k[i]) {
if (a[p] <= x && x <= b[p])
k[i]--;
p++;
if (p == n && !(k[i] == 0 && i == m - 1))
return 0;
}
}
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... |