This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//
// main.cpp
//
// Created by Panagiotis Chadjicostas on
// Copyright © Panagiotis Hadjicostas. All rights reserved.
//
#include "teams.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
#define fo(i,a,b) for(int i = a; i<=b; i++)
#define f(i,b) for(int i=0;i<b;i++)
#define F first
#define S second
#define sz size
#define ls s,m,idx<<1
#define rs m+1,e,idx<<1|1
const ll MOD=ll(1e9)+7;
const ll MAXN=2*ll(1e6);
///////////////////////////////////////////////////////////////////////
vector<pair<ll,ll> > V;
vector<vi> v;
bool cmp(ii a,ii b){
if(a.F<b.F)
return 1;
else if(b.F<a.F)
return 0;
else if(a.S<b.S)
return 1;
else
return 0;
}
void init(int N, int A[], int B[]){
v.assign(500001,vi());
for(ll i=0;i<N;i++){
//pair<ll,ll> p;
//p.F=A[i],p.S=A=B[i];
//V.push_back(p);
v[A[i]].push_back(B[i]);
}
//sort(V.begin(),V.end(),cmp);
}
int can(int M, int K[]){
sort(K,K+M);
multiset<ll> ms;
ll idx=0;
for(ll i=0;i<M;i++){
while(idx<=K[i]){
for(auto x:v[idx])
ms.insert(x);
idx++;
}
while(K[i]>=0&& !ms.empty()){
if(*ms.begin()>=K[i]){
K[i]--;
}
ms.erase(ms.begin());
}
if(K[i]>0)
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... |