제출 #186187

#제출 시각아이디문제언어결과실행 시간메모리
186187TAISA_팀들 (IOI15_teams)C++14
0 / 100
4094 ms8980 KiB
#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&&deg[id]==K[id]){ id++; } if(id==M){ return 1; } if(v[i].first>K[id]){ return 0; } if(v[i].first<=K[id]&&K[id]<=v[i].second){ deg[id]++; } } while(id<M&&deg[id]==K[id]){ id++; } return (id==M); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...