Submission #384605

#TimeUsernameProblemLanguageResultExecution timeMemory
384605moratoTeams (IOI15_teams)C++17
0 / 100
4070 ms9068 KiB
#include <bits/stdc++.h> #include "teams.h" using namespace std; const int MAXN = 5e5 + 5; int n; pair<int, int> segment[MAXN]; void init(int N, int A[], int B[]) { n = N; for (int i = 0; i < n; i++) { segment[i].first = A[i]; segment[i].second = B[i]; } sort(segment, segment + n, [](pair<int, int> a, pair<int, int> b) { if (a.second == b.second) return a.first < b.first; return a.second < b.second; }); } int can(int M, int K[]) { sort(K, K + M); int j = 0; for (int i = 0; i < M; i++) { int cnt = 0; for (; j < n && cnt < K[i]; j++) { if (segment[j].first <= K[i] && K[i] <= segment[j].second) { cnt++; } } if (cnt < K[i]) 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...