# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
209367 | autumn_eel | Teams (IOI15_teams) | C++14 | 4062 ms | 23012 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>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef pair<int,int>P;
P p[600000];
int n;
void init(int N, int A[], int B[]) {
n=N;
rep(i,N)p[i]=P(A[i],B[i]);
sort(p,p+N);
}
int can(int M, int K[]) {
sort(K,K+M);
priority_queue<P,vector<P>,greater<P>>que;
int s=0;
rep(i,M){
int x=K[i];
while(s<n&&p[s].first<=x)que.push(P(p[s].second,p[s].first)),s++;
while(!que.empty()&&que.top().first<x)que.pop();
if(que.size()<x)return 0;
rep(i,x)que.pop();
}
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... |