# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1014835 | ASN49K | Teams (IOI15_teams) | C++14 | 4037 ms | 38480 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>
#include "teams.h"
using namespace std;
#define all(x) x.begin(),x.end()
using pii=pair<int,int>;
int n;
vector<pii>a;
void init(int N, int *A, int *B)
{
a.resize(N);
n=N;
for(int i=0;i<N;i++)
{
a[i] = make_pair(A[i] , B[i]);
}
sort(all(a));
}
int can(int m, int k[])
{
multiset<int>mp;
for(int i=0,l=0;i<m;i++)
{
while(l<n && a[l].first<=k[i])
{
mp.insert(a[l++].second);
}
auto it=mp.begin();
while(mp.size() && *mp.begin()<k[i])
{
mp.erase(mp.begin());
}
if((int)mp.size()<k[i])
{
return false;
}
for(int j=0;j<k[i];j++)
{
mp.erase(mp.begin());
}
}
return true;
}
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... |