# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117444 | vjudge1 | Race (IOI11_race) | C++17 | 630 ms | 42232 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;
#define ll long long int
const int N = 2e5 + 1;
int n, k, max_depth;
int sz[N];
bool vis[N];
vector<pair<int, int>> adj[N];
int res = INT_MAX;
map<int, int> cnt;
int get_subtree_size(int u, int p)
{
sz[u] = 1;
for (auto [v, w] : adj[u])
{
if (v != p and !vis[v])
sz[u] += get_subtree_size(v, u);
}
return sz[u];
}
int get_centroid(int u, int p, int tree_size)
{
for (auto [v, w] : adj[u])
{
if (v != p and !vis[v] and (sz[v] * 2 > tree_size))
return get_centroid(v, u, tree_size);
}
# | 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... |