이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |