# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
859689 | lbadea1000 | Race (IOI11_race) | C++17 | 5 ms | 31576 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>
#include "race.h"
using namespace std;
const int NMAX = 2e5;
const int LOGMAX = 20;
const int INF = 1e9;
int totalSize;
vector<pair<int, int>> edges[NMAX];
vector<pair<long long, int>> distCentroidSubtree[NMAX];
int sz[NMAX];
int centroidParent[NMAX];
bool isIn[NMAX];
int level[NMAX];
int father[LOGMAX][NMAX];
void dfs(int node, int parent) {
for(auto child : edges[node]) {
if(child.first != parent) {
father[0][child.first] = node;
level[child.first] = level[node] + 1;
dfs(child.first, node);
}
}
}
void make_fathers(int root, int n) {
level[root] = 0;
Compilation message (stderr)
# | 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... |