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 <bits/stdc++.h>
#include "teams.h"
#define P pair<int,int>
#define pb push_back
#define mp make_pair
using namespace std;
int n;
vector<P>intervals;
void init(int N, int A[], int B[]) {
n = N;
for(int i=0;i<N;i++) {
intervals.pb(mp(B[i], A[i]));
}
sort(intervals.begin(), intervals.end());
}
int can(int M, int K[]) {
int pk = 0, pi = 0;
while(pk < M && pi < n) {
if(K[pk] <= intervals[pi].second && K[pk] >= intervals[pi].second) {
K[pk]--;
}
pi++;
if(K[pk] == 0) pk++;
}
int sum = 0;
for(int i=0;i<M;i++) {
sum += K[i];
}
return sum == 0;
}
/*int main() {
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... |