# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
742821 | Abrar_Al_Samit | Teams (IOI15_teams) | C++17 | 4081 ms | 19844 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;
const int nax = 100;
int n;
vector<pair<int,int>>a;
void init(int N, int A[], int B[]) {
n = N;
for(int i=0; i<n; ++i) {
a.emplace_back(A[i], B[i]);
}
sort(a.begin(), a.end());
}
int can(int M, int K[]) {
int at = 0;
sort(K, K+M);
multiset<int>res;
for(int i=0; i<M; ++i) {
while(at < n && a[at].first<=K[i]) {
if(a[at].second >= K[i]) {
res.insert(a[at].second);
}
++at;
}
while(!res.empty() && *res.begin()<K[i]) {
res.erase(res.begin());
}
if(res.size() < K[i]) return 0;
while(K[i]--) {
res.erase(res.begin());
}
}
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... |