# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727679 | mgl_diamond | Teams (IOI15_teams) | C++14 | 4072 ms | 9944 KiB |
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>
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define C make_pair
#define vec vector
#define ins push_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 1e5+5;
int n;
ii guy[N];
void init(int N, int A[], int B[]) {
n = N;
for(int i=0; i<n; ++i) guy[i] = {A[i], B[i]};
sort(guy, guy+n);
}
bool can(int M, int K[]) {
priority_queue<int> pq;
sort(K, K+M);
for(int i=0, j=0; i<M; ++i) {
while (j<n && guy[j].fi <= K[i])
pq.push(-guy[j++].se);
while (!pq.empty() && -pq.top() < K[i])
pq.pop();
while (K[i]--) {
if (pq.empty()) return 0;
pq.pop();
}
}
return 1;
}
Compilation message (stderr)
# | 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... |