# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
63330 | hamzqq9 | Teams (IOI15_teams) | C++14 | 4014 ms | 10376 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;
#define st first
#define nd second
#define MAX 100005
#define sz(x) ((int)x.size())
int N;
pair<int,int> A[MAX];
void init(int N, int A[], int B[]) {
::N=N;
for(int i=0;i<N;i++) ::A[i+1].st=A[i],::A[i+1].nd=B[i];
sort(::A+1,::A+1+N);
}
int can(int M, int K[]) {
multiset<int> s;
int tut=0;
for(int i=0;i<M;i++) {
while(tut+1<=N && A[tut+1].st<=K[i]) {
tut++;
s.insert(A[tut].nd);
}
while(sz(s) && *s.begin()<K[i]) s.erase(s.begin());
if(sz(s)<K[i]) return 0;
while(K[i]--) {
s.erase(s.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... |