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>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n,i,j;
pair<ll,ll> a[101010];
bool b[101010];
void init(int N, int A[], int B[]) {
n=N;
for(i=1;i<=n;i++)
{
a[i]=mp(B[i-1],A[i-1]);
}
sort(a+1,a+1+n);
}
int can(int M, int K[]) {
memset(b,0,sizeof(b));
sort(K,K+M);
for(i=0;i<M;i++)
{
ll he=K[i];
for(j=1;j<=n;j++)
{
if(!b[j]&&a[j].se<=K[i]&&K[i]<=a[j].fi)
{
he--;
b[j]=1;
}
if(he==0)
break;
}
if(he!=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... |