2020CCPC秦皇岛 J - Kingdom‘s Power
#include<bits/stdc++.h>
using namespace std;
vector<int>v[1000005];
int siz[1000005],dep[1000005];
int dp[2][1000005];
void dfs1(int x,int pre)
{
siz[x]=1;
if(x!=1)dep[x]=dep[pre]+1;
for(auto to:v[x])if(to!=pre)
{
dfs1(t
原创
2021-10-29 19:00:18 ·
177 阅读 ·
0 评论