树的直径
tomjobs
别慌,慌也没用
展开
-
Codeforces1405 D. Tree Tag(博弈,树直径)
Alice and Bob are playing a fun game of tree tag. The game is played on a tree of ???? vertices numbered from 1 to ????. Recall that a tree on ???? vertices is an undirected, connected graph with ????−1 edges. Initially, Alice is located at vertex ????, an原创 2020-09-08 16:36:09 · 278 阅读 · 0 评论 -
D - Super M CodeForces - 592D(树的直径)
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 roads. Every road connects exactly two distinct cities, and th原创 2020-08-02 23:15:59 · 225 阅读 · 0 评论 -
Anton and Tree CodeForces - 734E(树的直径)
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, each of them is painted black or white. Anton doesn’t like multicolored trees, so he wants to change the tree suc原创 2020-08-01 23:47:52 · 199 阅读 · 0 评论 -
ACWING351. 树网的核(树的直径)
设T=(V, E, W) 是一个无圈且连通的无向图(也称为无根树),每条边带有正整数的权,我们称T为树网(treenetwork),其中V, E分别表示结点与边的集合,W表示各边长度的集合,并设T有n个结点。 路径:树网中任何两结点a,b都存在唯一的一条简单路径,用d(a,b)表示以a,b为端点的路径的长度,它是该路径上各边长度之和。 我们称d(a,b)为a,b两结点间的距离。 一点v到一条路径P...原创 2020-03-28 16:29:18 · 210 阅读 · 0 评论 -
ACWING350. 巡逻(树的直径)
在一个地区有 n 个村庄,编号为1,2,…,n。 有 n-1 条道路连接着这些村庄,每条道路刚好连接两个村庄,从任何一个村庄,都可以通过这些道路到达其他任一个村庄。 每条道路的长度均为1个单位。 为保证该地区的安全,巡警车每天都要到所有的道路上巡逻。 警察局设在编号为1的村庄里,每天巡警车总是从警局出发,最终又回到警局。 为了减少总的巡逻距离,该地区准备在这些村庄之间建立 K 条新的道路,每条新道...原创 2020-03-25 15:44:09 · 218 阅读 · 0 评论