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>
using namespace std;
typedef long long ll;
typedef long unsigned long ull;
typedef double long ld;
int n, a[105], b[105];
void init(int N, int A[], int B[]) {
n = N;
for (int i = 0; i < n; i++) {
a[i] = A[i];
b[i] = B[i];
}
}
int can(int M, int K[]) {
sort(K, K + M);
vector<bool> was(n, false);
for (int i = 0; i < M; i++) {
for (int rep = 0; rep < K[i]; rep++) {
int id = -1;
for (int j = 0; j < n; j++) {
if (!was[j] && a[j] <= K[i] && K[i] <= b[j] && (id == -1 || b[j] < b[id])) {
id = j;
}
}
if (id == -1) return 0;
was[id] = true;
}
}
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... |