# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976581 | happy_node | Meetings 2 (JOI21_meetings2) | C++17 | 4022 ms | 15340 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 MX=2e5+5;
int N;
vector<int> adj[MX];
int sz[MX], ans[MX];
void dfs(int v, int p, int head, int dep) {
sz[v]=1;
for(auto u:adj[v]) {
if(u==p) continue;
dfs(u,v,head,dep+1);
sz[v]+=sz[u];
}
}
void dfs2(int v, int p, int head, int dep) {
for(auto u:adj[v]) {
if(u==p) continue;
dfs2(u,v,head,dep+1);
}
int k=min(sz[v],N-sz[head]);
ans[2*k]=max(ans[2*k],dep+1);
}
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |