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=1e5+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);
int idx=n-1;
for (int i=0; i<M; i++)
{
int cnt=K[i];
while (cnt>0&&idx>=0&&v[idx].second>=K[i]&&K[i]>=v[idx].first) idx--, cnt--;
if (cnt>0) return 0;
}
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... |