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;
int n;
const int maxn=5e5;
pair<int,int> a[maxn+1];
void init(int N, int A[], int B[]) {
n=N;
for(int i=0;i<n;i++)a[i]={A[i],B[i]};
sort(a,a+n);
}
int can(int m, int k[]) {
sort(k,k+m);
int idx=0;
priority_queue<int> pq;
for(int i=0;i<m;i++){
int x=k[i];
while(idx<n&&a[idx].first<=x){
pq.push(-a[idx].second);
idx++;
}
while(!pq.empty()&&-pq.top()<x)pq.pop();
while(x--){
if(pq.empty())return 0;
pq.pop();
}
}
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... |