#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> ve;
vector<int> ms;
void init(int N, int A[], int B[]) {
ve.clear();
ve.resize(N);
for (int t1 = 0; t1 < N; t1 ++) {
ve[t1] = {A[t1], B[t1]};
}
sort(ve.begin(), ve.end());
}
int can(int M, int K[]) {
int n = ve.size(), l = 0, aux, r;
ms.clear();
ms.resize(M);
for (int t1 = 0; t1 < M; t1 ++) {
ms[t1] = K[t1];
}
sort(ms.begin(), ms.end());
while (r < M && (l < n)) {
aux = ms[r];
while (aux != 0 && (l < n)) {
if (ve[l].first <= ms[r] && ms[r] <= ve[l].second) {
aux --;
}
l ++;
}
if (aux != 0) {
return 0;
} else {
r ++;
}
}
return 1;
}
# | 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... |