# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
412803 | nichke | Race (IOI11_race) | C++14 | 1437 ms | 49752 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;
int ans = INT_MAX;
int sz[200005];
vector<pair<int, int>> adj[200005];
bool removed[200005];
void dfssz(int v, int par = -1) {
sz[v] = 1;
for (auto u : adj[v]) {
if (u.first == par) continue;
if (removed[u.first]) continue;
dfssz(u.first, v);
sz[v] += sz[u.first];
}
}
int centroid(int v, int full, int par = -1) {
for (auto u : adj[v]) {
if (u.first == par) continue;
if (removed[u.first]) continue;
if (sz[u.first] * 2 > full) {
return centroid(u.first, full, v);
}
}
return v;
}
void update(map<int, int>& mp, map<int, int>& mp2, int len, int val, int K) {
# | 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... |