Submission #976581

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9765812024-05-06 18:41:28happy_nodeMeetings 2 (JOI21_meetings2)C++17
20 / 100
4022 ms15340 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...