Submission #916118

#TimeUsernameProblemLanguageResultExecution timeMemory
916118Trisanu_DasTeams (IOI15_teams)C++17
21 / 100
82 ms23396 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; const int nx=1e2+5; int n; bool used[nx]; vector<pair<int, int>> v; void init(int N, int A[], int B[]) { n=N; for (int i=0; i<N; i++) v.push_back({A[i], B[i]}); sort(v.begin(), v.end()); } int can(int M, int K[]) { sort(K, K+M); reverse(K, K+M); bool f=0; for (int i=0; i<n; i++) used[i]=0; for (int i=0; i<M; i++) { int cnt=K[i]; for (int j=n-1; j>=0; j--) if (cnt>0&&!used[j]&&v[j].second>=K[i]&&K[i]>=v[j].first) used[j]=1, cnt--; if (cnt>0) f=1; } return f?0: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...