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;
typedef pair<int,int> pii;
#define f first
#define s second
vector<pii> e;
void init(int N, int A[], int B[]) {
for(int i=0; i<N; i++){
e.push_back({B[i], A[i]});
}
sort(e.begin(), e.end());
}
int can(int M, int K[]) {
sort(K, K+M);
vector<pii> wtf(M);
for(int i=0; i<M; i++){
wtf[i] = {K[i], K[i]};
}
int i = 0;
for(pii p : e){
while(i<M and wtf[i].s == 0) i++;
if(i == M) break;
if(p.s <= wtf[i].f) wtf[i].s--;
}
while(i<M and wtf[i].s == 0) i++;
return (i == M);
return 0;
}
# | 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... |