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 rep(i,a,b) for (int i = (a); i <= (b); i++)
#define repa(i,a,b) for (int i = (a); i >= (b); i--)
#define lli long long int
#define debugsl(a) cout << #a << " = " << a << ", "
#define debug(a) cout << #a << " = " << a << endl
#define d first
#define u second
vector <pair<lli, lli> > orden;
lli falt,act;
void init(int N, int A[], int B[]) {
rep(i,0,N-1) orden.push_back({A[i],B[i]});
sort(orden.begin(), orden.end());
}
int can(int M, int K[]) {
sort(K,K+M);
act = 0;
falt = K[act];
for (auto nino : orden) {
if (nino.d > K[act]) return 0;
if (nino.d <= K[act] && nino.u >= K[act]) {
falt--;
if(falt == 0){
act++;
if (act == M) return 1;
else falt = K[act];
}
}
}
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... |