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;
struct S{int l,r;}a[100100];
bool cmp(S x,S y){return x.l<y.l?1:(x.r<y.r?1:0);}
int n;
void init(int N, int A[], int B[]){
n=N;
for (int i=0;i<N;i++)a[i].l=A[i],a[i].r=B[i];
sort(a,a+N,cmp);
}
int can(int M, int K[]){
int head=0;
sort(K,K+M);
for (int i=0;i<M;i++){
int tmp=0;
for(;;){
if (a[head].l<=K[i]&&K[i]<=a[head].r)tmp++;
head++;
if (tmp==K[i])break;
if (head==n)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... |