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;
#define pb push_back
#define ll long long
#define fi first
#define se second
#define sz(x) (int)(x.size())
vector<pair<int,int> > vec;
void init(int N, int A[], int B[]) {
vec.resize(N);
for (int i = 0; i < N; ++i)
vec[i]={A[i],B[i]};
sort(vec.begin(),vec.end());
}
int can(int M, int K[]) {
sort(K,K+M);
multiset<int> myset;
int idx=0;
for (int i = 0; i < M; ++i)
{
while(idx<sz(vec) && vec[idx].fi<=K[i])
myset.insert(vec[idx].se),idx++;
while(sz(myset)&&((*myset.begin())<K[i]))
myset.erase(myset.begin());
if(sz(myset)<K[i])return 0;
for (int j = 0; j < K[i]; ++j)
myset.erase(myset.begin());
}
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... |