# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
419821 | MohamedAhmed04 | Teams (IOI15_teams) | C++14 | 4081 ms | 53292 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"
//#include "grader.cpp"
using namespace std ;
const int MAX = 5e5 + 10 ;
vector<int>v[MAX] ;
int n ;
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[])
{
sort(K , K + m) ;
multiset<int>s ;
int last = 0 ;
for(int i = 0 ; i < m ; ++i)
{
for(int j = last+1 ; j <= K[i] ; ++j)
{
for(auto &k : v[j])
s.insert(k) ;
}
while(s.size() && (*s.begin()) < K[i])
s.erase(s.begin()) ;
if(s.size() < K[i])
return 0 ;
for(int j = 0 ; j < K[i] ; ++j)
s.erase(s.begin()) ;
last = K[i] ;
}
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... |