# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
386291 | model_code | Meetings 2 (JOI21_meetings2) | C++17 | 580 ms | 50796 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>
#define SIZE 200005
#define BT 21
using namespace std;
typedef pair <int, int> P;
vector <int> vec[SIZE];
vector <int> vt[SIZE];
int nd[SIZE], ans[SIZE];
P centroid(int v, int p, int all) {
P ret = P(all, v);
int mx = 0;
nd[v] = 1;
for(int i=0; i < vec[v].size(); i++) {
int to = vec[v][i];
if(to != p) {
ret = min(ret, centroid(to, v, all));
nd[v] += nd[to];
mx = max(mx, nd[to]);
}
}
mx = max(mx, all - nd[v]);
ret = min(ret, P(mx, v));
return ret;
}
int par[SIZE][BT], dep[SIZE];
void dfs(int v, int p, int d) {
dep[v] = d;
par[v][0] = p;
nd[v] = 1;
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... |