# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170896 | WLZ | Race (IOI11_race) | C++14 | 1964 ms | 62728 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 "race.h"
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, k, ans = INF;
vector< map<int, int> > g;
vector<int> sz;
map<int, int> len, new_len;
int dfs(int u, int par) {
sz[u] = 1;
for (auto& v : g[u]) {
if (v.first != par) {
sz[u] += dfs(v.first, u);
}
}
return sz[u];
}
int find_centroid(int u, int par, int n) {
for (auto& v : g[u]) {
if (v.first != par && sz[v.first] > n / 2) {
return find_centroid(v.first, u, n);
}
}
return u;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |