# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830879 | drdilyor | Teams (IOI15_teams) | C++17 | 4066 ms | 18268 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "teams.h"
using namespace std;
using ll = long long;
int n;
vector<pair<int,int>> arr;
void init(int n, int* a, int* b) {
::n = n;
arr.resize(n);
for( int i = 0; i < n; i++)
arr[i] = {a[i], b[i]};
}
int can(int m, int* ts) {
sort(ts, ts + m, greater());
sort(arr.begin(), arr.end(), greater());
vector<int> used(n);
int team = 0;
while (team < m) {
int cnt = 0;
for (int student = 0; student < n; student++) {
if (used[student]) continue;
auto [l,r] = arr[student];
if (l <= ts[team] && ts[team] <= r) {
used[student] = 1;
cnt++;
}
}
if (cnt == ts[team]) team++;
else break;
}
return team == m;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |