摘要:
类似没有上司的舞会,找到环上一点,将环断开,强制是否选择root,做树形dp #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+1e5; int h[N],ne[N*2],e[N*2] 阅读全文
摘要:
本题是基环树模板题,但是有一点要注意,特判两元环是必要的 因为两元环中,我们要选权值大的两条边组成的直径,而多元环则不用在意,因为每两个点之间只有一条边 #include<bits/stdc++.h> using namespace std; typedef long long ll; const 阅读全文