# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
107181 | stefdasca | Bosses (BOI16_bosses) | C++14 | 605 ms | 804 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, cost, ans = (1<<30);
vector<int>v[5002];
int viz[5002];
int s;
void bfs(int nod)
{
memset(viz, 0, sizeof(viz));
viz[nod] = 1;
queue<int>q;
q.push(nod);
cost = 1;
while(!q.empty())
{
int t = q.front();
q.pop();
for(int j = 0; j < v[t].size(); ++j)
{
int vecin = v[t][j];
if(!viz[vecin])
{
s++;
viz[vecin] = viz[t] + 1;
cost += viz[vecin];
q.push(vecin);
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |