# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172452 | nguyenkhangninh99 | Bosses (BOI16_bosses) | C++17 | 425 ms | 780 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn = 5e3 + 5;
vector<int> adj[maxn];
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n; cin >> n;
for(int i = 1; i <= n; i++){
int sz; cin >> sz;
for (int j = 1; j <= sz; j++) {
int k; cin >> k;
adj[k].push_back(i);
}
}
int res = 1e9;
for(int i = 1; i <= n; i++){
vector<int> d(n + 1, 1e9);
d[i] = 0;
queue<int> q;
q.push(i);
while(!q.empty()){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |