제출 #987510

#제출 시각아이디문제언어결과실행 시간메모리
987510OAleksa팀들 (IOI15_teams)C++14
0 / 100
4027 ms18404 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; /* g++ teams.cpp grader.cpp teams.h ./a.out */ const int N = 5e5 + 69; int n, a[N], b[N], ord[N]; void init(int _n, int _a[], int _b[]) { n = _n; for (int i = 0;i < n;i++) { a[i] = _a[i]; b[i] = _b[i]; ord[i] = i; } sort(ord, ord + n, [&](int i, int j) { return b[i] < b[j]; }); } int can(int m, int k[]) { int ptr = 0; sort(k, k + m); for (int i = 0;i < m;i++) { int s = 0; while (s < k[i] && ptr < n) { int j = ord[ptr]; if (a[j] <= k[i] && b[j] >= k[i]) s += 1; ptr += 1; } if (s < 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...