Submission #852032

#TimeUsernameProblemLanguageResultExecution timeMemory
85203212345678Teams (IOI15_teams)C++17
0 / 100
101 ms23116 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; const int nx=1e5+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); int idx=n-1; for (int i=0; i<M; i++) { int cnt=K[i]; while (cnt>0&&idx>=0&&v[idx].second>=K[i]&&K[i]>=v[idx].first) idx--, cnt--; if (cnt>0) 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...