# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256997 | rama_pang | Bosses (BOI16_bosses) | C++14 | 875 ms | 760 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;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int N;
cin >> N;
vector<vector<int>> adj(N);
for (int i = 0; i < N; i++) {
int k;
cin >> k;
while (k--) {
int a;
cin >> a;
a--;
adj[a].emplace_back(i);
}
}
auto Solve = [&](int s) -> long long {
vector<int> dist(N, -1);
queue<int> q;
q.emplace(s);
dist[s] = 0;
while (!q.empty()) {
int u = q.front();
q.pop();
for (auto v : adj[u]) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |