# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
394214 | oolimry | Meetings 2 (JOI21_meetings2) | C++17 | 840 ms | 31060 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;
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) x.size())
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << ", " << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint, lint> ii;
int n;
int ans[200005];
vector<int> adj[200005];
bool cented[200005];
int sz[200005];
int dis[200005];
vector<int> nodes;
void dfs(int u, int p){
nodes.push_back(u);
sz[u] = 1;
for(int v : adj[u]){
if(cented[v] or v == p) continue;
dis[v] = dis[u]+1;
dfs(v, u);
sz[u] += sz[v];
}
}
void init(int u, int p = -1){
dis[u] = 0;
nodes.clear();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |