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 nx=1e2+5;
int n;
bool used[nx];
vector<pair<int, int>> v;
void init(int N, int A[], int B[]) {
n=N;
for (int i=0; i<N; i++) v.push_back({A[i], B[i]});
sort(v.begin(), v.end());
}
int can(int M, int K[]) {
sort(K, K+M);
reverse(K, K+M);
bool f=0;
for (int i=0; i<n; i++) used[i]=0;
for (int i=0; i<M; i++)
{
int cnt=K[i];
for (int j=n-1; j>=0; j--) if (cnt>0&&!used[j]&&v[j].second>=K[i]&&K[i]>=v[j].first) used[j]=1, cnt--;
if (cnt>0) f=1;
}
return f?0: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... |