![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树的直径
lonely_wind_
路漫漫兮
展开
-
洛谷P1099&Noip 2007提高-树网的核(树直径上的尺取)
题目链接:https://www.luogu.com.cn/problem/P1099 博客园食用链接:https://www.cnblogs.com/lonely-wind-/p/13456497.html 题目描述 设 T=(V,E,W)T=(V,E,W)T=(V,E,W) 是一个无圈且连通的无向图(也称为无根树),每条边到有正整数的权,我们称 TTT 为树网(treenetwork),其中 VVV,EEE 分别表示结点与边的集合,WWW 表示各边长度的集合,并设 TTT 有 nnn 个结点。 路径:树原创 2020-08-08 09:46:55 · 448 阅读 · 0 评论 -
CodeForces 734E-Anton and Tree(并查集缩点+树的直径)
题目链接:https://codeforces.com/problemset/problem/734/E 博客园食用链接:https://www.cnblogs.com/lonely-wind-/p/13417220.html Anton is growing a tree in his garden. In case you forgot, the tree is a connected acyclic undirected graph. There are n vertices in the tree,原创 2020-08-01 23:30:06 · 338 阅读 · 0 评论 -
CodeForces 592D-Super M(树上生成树+树的直径之树DP的缺点)
题目链接:https://codeforces.com/problemset/problem/592/D 博客园食用链接: Ari the monster is not an ordinary monster. She is the hidden identity of Super M, the Byteforces’ superhero. Byteforces is a country that consists of n cities, connected by n - 1 bidirectional原创 2020-08-06 09:10:04 · 341 阅读 · 0 评论