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"
using namespace std;
const int MAXN = 1e5 + 5;
int n;
pair<int, int> segment[MAXN];
void init(int N, int A[], int B[]) {
n = N;
for (int i = 0; i < n; i++) {
segment[i].first = A[i];
segment[i].second = B[i];
}
sort(segment, segment + n);
}
int can(int M, int K[]) {
sort(K, K + M);
for (int i = 0, j = 0; i < M; i++) {
int cnt = 0;
for (; j < n; j++) {
if (segment[j].first <= K[i] && K[i] <= segment[j].second) {
cnt++;
}
if (cnt == K[i]) break;
}
if (cnt < K[i]) return 0;
}
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... |