Submission #374745

#TimeUsernameProblemLanguageResultExecution timeMemory
374745ijxjdjdTeams (IOI15_teams)C++14
34 / 100
4078 ms17004 KiB
#include "teams.h" #include <bits/stdc++.h> #define all(x) begin(x), end(x) using namespace std; const int MAXN = (int)(1e5); vector<pair<int, int>> vec; bool used[MAXN]; int N; void init(int n, int A[], int B[]) { N = n; vec.resize(N); for (int i = 0; i < N; i++) { vec[i] = {B[i], A[i]}; } sort(all(vec)); } int can(int M, int K[]) { memset(used, 0, sizeof(used)); vector<int> k(M); for (int i = 0; i < M; i++) { k[i] = K[i]; } sort(all(k)); for (int a : k) { int temp = a; for (int i = 0; i < N; i++) { if (!used[i] && vec[i].second <= a && a <= vec[i].first) { temp--; used[i] = true; if (temp == 0) { break; } } } if (temp != 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...