# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
390177 | georgerapeanu | Meetings 2 (JOI21_meetings2) | C++11 | 555 ms | 50200 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;
const int NMAX = 2e5;
const int LGMAX = 18;
int n;
vector<int> graph[NMAX + 5];
int weight[NMAX + 5];
int father[LGMAX + 1][NMAX + 1];
int lvl[NMAX + 1];
void predfs(int nod,int tata){
weight[nod] = 1;
father[0][nod] = tata;
lvl[nod] = 1 + lvl[tata];
for(auto it:graph[nod]){
if(it == tata){
continue;
}
predfs(it,nod);
weight[nod] += weight[it];
}
}
int get_centroid(int nod){
int tata = 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... |