Submission #147610

#TimeUsernameProblemLanguageResultExecution timeMemory
147610nandonathanielTeams (IOI15_teams)C++14
0 / 100
4075 ms16724 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; pii V[100005]; bool sudah[100005]; bool cmp(pii x,pii y){ return x.second<y.second; } int n; void init(int N, int A[], int B[]) { for(int i=0;i<N;i++)V[i]=make_pair(A[i],B[i]); sort(V,V+N,cmp); n=N; } int can(int M, int K[]) { memset(sudah,false,sizeof(sudah)); sort(K,K+M); for(int i=0;i<M;i++){ int brp=0; bool ya=false; for(int j=0;j<n;j++){ if(!sudah[i] && K[i]>=V[j].first && K[i]<=V[j].second){ brp++; sudah[i]=true; } if(brp==K[i]){ ya=true; break; } } if(!ya)return 0; } return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...