# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
67044 | nvmdava | 팀들 (IOI15_teams) | C++17 | 0 ms | 0 KiB |
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 unit{
int l, r;
};
vector<unit> v;
void init(int N, int A[], int B[]) {
sort(A, A + N);
sort(B, B + N);
unit t;
for(i = 0; i < N; i++){
t.l = A[i];
t.r = B[i];
v.push_back(t);
}
}
int can(int M, int K[]) {
int t = K[0], i = 0;
for(auto x : v){
if(K[i] < x.l){
return 0;
}
if(K[i] <= x.r){
t--;
if(t == 0){
i++;
if(i == M){
return 1;
}
t = K[i];
}
}
}
return 0;
}