摘要: 一个子树的重心一定是在子树的重儿子与当前根的路径上 #include<bits/stdc++.h> using namespace std; const int inf=0x3f3f3f3f; const int N=1e6+10; int h[N],ne[N],e[N],idx; int ans[ 阅读全文
posted @ 2020-10-19 23:38 朝暮不思 阅读(168) 评论(0) 推荐(0)
摘要: A题 莽结论,注意特判0 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=1e5+10; int main(){ ll n,k; cin 阅读全文
posted @ 2020-10-19 22:01 朝暮不思 阅读(214) 评论(0) 推荐(0)