# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
608598 | loctildore | Teams (IOI15_teams) | C++14 | 4093 ms | 16676 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 "teams.h"
#include <bits/stdc++.h>
using namespace std;
// trans rights
#define ll long long
#define f first
#define s second
#define endl '\n'
#define all(x) begin(x), end(x)
int n;
vector<pair<int,int>> vctr;
void init(int N, int A[], int B[]) {
n=N;
for (int i = 0; i < n; i++) {
vctr.push_back({A[i],B[i]});
}
sort(all(vctr));
}
priority_queue<int,vector<int>,greater<int>> pq;
int can(int M, int K[]) {
int cur=0;
for (int i = 0; i < M; i++) {
while (cur<n&&vctr[cur].f<=K[i]) {
pq.push(vctr[cur++].s);
}
while (pq.size()&&pq.top()<K[i]) {
pq.pop();
}
if (pq.size()<K[i]) {
return 0;
}
for (int j = 0; j < K[i]; j++) {
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... |