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 long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpi;
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
#define pb push_back
#define rsz resize
#define sz(x) int(x.size())
#define all(x) begin(x), end(x)
#define fi first
#define se second
int const N=5e5+3;
pii ba[N];
int n;
void init(int n1, int A[], int B[]) {
n=n1;
F0R(i,n)
{
ba[i]={B[i],A[i]};
}
sort(ba,ba+n);
}
int can(int M, int K[]) {
sort(K,K+M);
int mdex=0;
int cnt=0;
F0R(i,n)
{
if(ba[i].se>K[mdex])continue;;
if(ba[i].fi<K[mdex])continue;
++cnt;
if(cnt==K[mdex])
{
++mdex;
cnt=0;
}
if(mdex==M)break;
}
return mdex==M;
}
# | 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... |