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;
pair<int, int> people[100100];
int n;
void init(int N, int A[], int B[]) {
n = N;
for(int i = 0; i < n; i++)
people[i] = {B[i], A[i]};
sort(people, people+n);
for(int i = 0; i < n; i++)
swap(people[i].first, people[i].second);
}
int can(int M, int K[]) {
sort(K, K+M);
int cur = 0, got = 0;
for(int i = 0; i < n; i++) {
if(people[i].second < K[cur]||people[i].first>K[cur]) continue;
got++;if(got==K[cur]){if(++cur==M) return 1;}
}
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... |