이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
long long n, pos, sum;
vector<pair<int, int> > sz;
vector<int> kerd;
bool can(int m, int a[]) {
pos=0, sum=0;
for (int i=0; i<m; i++) sum+=a[i];
if (sum>n) return 0;
kerd.clear();
for (int i=0; i<m; i++) for (int j=0; j<a[i]; j++) kerd.push_back(a[i]);
sort(kerd.begin(), kerd.end());
for (int i=0; i<n; i++) {
if (pos<sum && sz[i].second<=kerd[pos] && kerd[pos]<=sz[i].first) pos++;
}
return (pos==sum);
}
void init(int p, int a[], int b[]) {
n=p;
for (int i=0; i<n; i++) sz.push_back({b[i], a[i]});
sort(sz.begin(), sz.end());
}
# | 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... |