Submission #134555

#TimeUsernameProblemLanguageResultExecution timeMemory
134555BoxworldTeams (IOI15_teams)C++14
0 / 100
4088 ms9976 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; struct S{int l,r;}a[100100]; bool cmp(S x,S y){return x.l<y.l?1:(x.r<y.r?1:0);} int n; void init(int N, int A[], int B[]){ n=N; for (int i=0;i<N;i++)a[i].l=A[i],a[i].r=B[i]; sort(a,a+N,cmp); } int can(int M, int K[]){ int head=0; sort(K,K+M); for (int i=0;i<M;i++){ int tmp=0; for(;;){ if (a[head].l<=K[i]&&K[i]<=a[head].r)tmp++; head++; if (tmp==K[i])break; if (head==n)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...