# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1096937 | Zone_zonee | Bosses (BOI16_bosses) | C++17 | 388 ms | 780 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 n;
vector<int> adj[5050];
bool vis[5050];
int bfs(int f){
memset(vis, 0, sizeof vis);
int res = 0, cnt = 0;
queue<pair<int, int>> q;
q.emplace(f, 1);
vis[f] = 1;
while(!q.empty()){
auto [u, d] = q.front(); q.pop();
res += d;
cnt++;
for(int v : adj[u]){
if(vis[v]) continue;
vis[v] = 1;
q.emplace(v, d + 1);
}
}
if(cnt == n) return res;
return 1e9;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for(int i = 1; i <= n; ++i){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |