# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
675066 | benjaminkleyn | Bosses (BOI16_bosses) | C++17 | 638 ms | 644 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;
typedef long long ll;
int n;
vector<int> children[5001];
bool vis[5001];
int dist[5001];
int main()
{
cin >> n;
for (int i = 1, k; i <= n; i++)
{
cin >> k;
for (int j = 0, par; j < k; j++)
{
cin >> par;
children[par].push_back(i);
}
}
ll ans = LLONG_MAX;
for (int root = 1; root <= n; root++)
{
queue<int> q;
q.push(root);
memset(vis, false, sizeof(vis));
vis[root] = true;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |