# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145056 | mosesmayer | Bosses (BOI16_bosses) | C++17 | 1110 ms | 816 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
using namespace std;
typedef vector<int> vi;
typedef long long LL;
const LL LINF = 1e18;
const int mxsz = 5e3 + 5;
int n;
vi adj[mxsz];
queue<int> q;
int dep[mxsz], ord[mxsz], lvl[mxsz];
LL test(int rt){
while (!q.empty()) q.pop();
fill(dep+1, dep+n+1, 0x3f3f3f3f);
fill(lvl, lvl+n+1, 0);
dep[rt] = 0;
q.push(rt);
while (!q.empty()){
int u = q.front(); q.pop();
for (int nx : adj[u]){
if (dep[nx] > dep[u] + 1){
dep[nx] = dep[u] + 1;
q.push(nx);
}
}
}
int mx = 0;
for (int i = 1; i <= n; i++) mx = max(mx, dep[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... |