# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
533185 | gilbirb | Bosses (BOI16_bosses) | C++14 | 622 ms | 648 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>
#define pb push_back
#define fi first
#define se second
typedef long long ll;
using namespace std;
ll n, ans = 1e9;
vector<ll>adj[5005];
ll p[5005];
void bfs(ll s){
memset(p, 0, sizeof(p));
p[s] = 1;
queue<ll>q;
q.push(s);
while(!q.empty()){
ll cur = q.front();
q.pop();
for(int x : adj[cur]){
if(!p[x]){
p[x] = p[cur]+1;
q.push(x);
}
}
}
ll total = 0;
for(int i = 1; i <= n; i++){
if(!p[i]) return;
total += p[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... |