# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133775 | Runtime_error_ | Teams (IOI15_teams) | C++14 | 4018 ms | 52952 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 inf = 5e5+9;
int n;
vector<int> v[inf],team[inf];
void init(int N, int A[], int B[]) {
n = N;
for(int i=0;i<n;i++)
v[ A[i] ] .push_back( B[i] );
}
int can(int M, int K[]) {
multiset<int> CurEnd;
for(int i=0;i<M;i++)
team[ K[i] ].push_back( K[i] );
for(int i=1;i<=n;i++){
for(auto o:v[i])
CurEnd.insert(o);
for(auto o:team[i]){
if(CurEnd.size()<o)
return 0;
while(o--)
CurEnd.erase(CurEnd.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... |