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>
#define uwu return;
#define OwO return 0;
#define IwI return 1;
using namespace std;
vector <pair<int, int>> intervals;
#define fs first
#define sc second
void init(int N, int A[], int B[]) {
for(int i = 0; i < N; i++){
intervals.push_back({A[i], B[i]});
}
sort(intervals.begin(), intervals.end());
uwu
}
int can(int M, int K[]) {
vector <int> in_K;
for(int i = 0; i < M; i++){
in_K.push_back(K[i]);
}
sort(in_K.begin(), in_K.end());
int ptr = 0;
priority_queue <int> pq;
for(auto i:in_K){
while(ptr < (int) intervals.size() && intervals[ptr].fs <= i){
pq.push(-intervals[ptr].sc);
ptr++;
}
while(!pq.empty() && -pq.top() < i){
pq.pop();
}
int cnt = i;
while(cnt--){
if(pq.empty()) OwO
pq.pop();
}
}
IwI
}
# | 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... |