# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
445274 | prvocislo | Olympiads (BOI19_olympiads) | C++17 | 68 ms | 1668 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>
using namespace std;
struct node
{
vector<bool> forbidden;
vector<int> forced, team;
int score;
};
inline bool operator<(const node &a, const node &b) { return a.score < b.score; }
int n, k, c, t[505][6];
void finish_team(node &no)
{
no.team = no.forced;
for (int i = no.team.size(); i < k; i++)
{
no.team.push_back(-1);
for (int j = 0; j < n; j++)
if (!no.forbidden[j] && !count(no.team.begin(), no.team.end(), j) && (no.team.back() == -1 || t[j][i] > t[no.team.back()][i]))
no.team.back() = j;
}
no.score = 0;
for (int i = 0; i < k; i++)
{
int maxi = 0;
for (int j : no.team) maxi = max(maxi, t[j][i]);
no.score += maxi;
}
}
int main()
# | 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... |