# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
186172 | TAISA_ | Teams (IOI15_teams) | C++14 | 4097 ms | 16392 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;
using P=pair<int,int>;
vector<P> v;
int n;
void init(int N, int A[], int B[]) {
for(int i=0;i<N;i++){
v.emplace_back(A[i],B[i]);
}
n=N;
sort(v.begin(),v.end());
}
int can(int M, int K[]) {
sort(K,K+M);
vector<int> deg(M);
int id=0;
for(int i=0;i<n;i++){
while(id<M&°[id]==K[id]){
id++;
}
int l=lower_bound(K,K+M,v[i].first)-K;
int r=upper_bound(K,K+M,v[i].second)-K;
r--;
if(l>r){
continue;
}
if(l>id){
return 0;
}
if(id<=r){
deg[l]++;
}
}
while(id<M&°[id]==K[id]){
id++;
}
return (id==M);
}
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... |