# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
37163 | cheater2k | 007 (CEOI14_007) | C++14 | 339 ms | 18956 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;
const int N = 200005;
int n, m, s, d, a, b;
vector<int> G[N];
int fa[N], fb[N];
void bfs(int start, int f[]) {
for (int i = 1; i <= n; ++i) f[i] = -1;
f[start] = 0;
queue <int> q; q.push(start);
while(!q.empty()) {
int u = q.front(); q.pop();
for (int v : G[u]) if (f[v] == -1) {
f[v] = f[u] + 1; q.push(v);
}
}
}
int maxdep(int start) {
vector<int> d(n + 1, -1);
queue <int> q; q.push(start); d[start] = 0;
int ans = 0;
while(!q.empty()) {
int u = q.front(); q.pop();
ans = max(ans, d[u]);
for (int v : G[u]) if (fa[v] == fa[u] - 1 && fb[v] == fb[u] - 1 && d[v] == -1) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |