# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953382 | efishel | Race (IOI11_race) | C++17 | 296 ms | 74580 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;
using ll = long long;
using vll = vector <ll>;
const ll MAXN = 1E6+16;
vector <pair <ll, ll> > adj[MAXN];
vector <char> used(MAXN, false);
vll sz(MAXN);
ll dfs_subsz (ll u, ll par) {
sz[u] = 1;
for (auto [v, w] : adj[u]) {
if (v == par) continue;
if (used[v]) continue;
sz[u] += dfs_subsz(v, u);
}
return sz[u];
}
ll dfs_ctd (ll u, ll par, ll n) {
for (auto [v, w] : adj[u]) {
if (v == par) continue;
if (used[v]) continue;
if (sz[v] > n/2) return dfs_ctd(v, 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... |