# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94228 | arknave | Race (IOI11_race) | C++14 | 1723 ms | 53160 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>
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
void dfs_sz(const vector<vector<pii>>& tree, vi& vis, vi& size, int u, int p = -1) {
size[u] = 1;
for (auto& e : tree[u]) {
int v = e.first;
if (v == p or vis[v])
continue;
dfs_sz(tree, vis, size, v, u);
size[u] += size[v];
}
}
int find_center(const vector<vector<pii>>& tree, vi& vis, vi& size, int tot, int u, int p = -1) {
for (auto& e : tree[u]) {
int v = e.first;
if (v == p or vis[v])
continue;
if (2 * size[v] >= tot)
return find_center(tree, vis, size, tot, v, 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... |