# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57858 | E869120 | Teams (IOI15_teams) | C++14 | 4018 ms | 20284 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;
vector<pair<int,int>>vec;int N;bool used[100009];
void init(int NN, int A[], int B[]) {
N=NN;
for(int i=0;i<N;i++) vec.push_back(make_pair(B[i],A[i]));
sort(vec.begin(),vec.end());
}
int can(int M, int K[]) {
for(int i=0;i<N;i++) used[i]=false;
sort(K,K+M);
int cx=0;
for(int i=0;i<M;i++){
int cnt=0;
for(int j=0;j<N;j++){
if(used[j]==true) continue;
if(vec[j].second<=K[i] && K[i]<=vec[j].first) {
cnt++;used[j]=true;
}
if(cnt==K[i]) break;
}
if(cnt!=K[i]) return 0;
}
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... |