#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e17;
typedef long long ll;
const ll MOD=1e9+7;
#define P pair
#define S second
#define F first
#define pb push_back
#define V vector
#define all(v) v.begin(),v.end()
V<P<int,int>>a;
int n;
bool cus(P<int,int>x,P<int,int>y){
return x.S<y.S;
}
void init(int N, int A[], int B[]) {
n=N;
for(int i=0;i<n;i++){
a.pb({A[i],B[i]});
}
sort(all(a),cus);
}
int can(int M, int K[]) {
sort(K,K+M);
int id=0;
bool b[n];
for(int i=0;i<n;i++){
b[i]=false;
}
for(int i=0;i<M;i++){
for(int j=0;j<K[i];j++){
bool f=false;
for(int g=0;g<n;g++){
if(a[g].F<=K[i] && K[i]<=a[g].S && !b[g]){
f=true;
b[g]=true;
break;
}
}
if(!f){
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... |