YunYan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  树论---树的直径

摘要:一所学校不久前买了第一台电脑(所以这台电脑的ID是1)。近年来,学校购买了N-1新电脑。每台新电脑都连接到一台先前安装的电脑上。学校的管理人员担心网络运行缓慢,希望知道第i台计算机需要发送信号的最大距离si(即到最远计算机的电缆长度)。您需要提供此信息。 提示:示例输入与此图对应。从图中,你可以看到 阅读全文
posted @ 2019-07-25 21:22 Target--fly 阅读(234) 评论(0) 推荐(0)

摘要:Given a tree (a connected graph with no cycles), you have to find the farthest nodes in the tree. The edges of the tree are weighted and undirected. T 阅读全文
posted @ 2019-07-25 13:22 Target--fly 阅读(175) 评论(0) 推荐(0)

摘要:Building and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such that there is 阅读全文
posted @ 2019-07-25 13:19 Target--fly 阅读(266) 评论(0) 推荐(0)

摘要:After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marath 阅读全文
posted @ 2019-07-25 13:15 Target--fly 阅读(132) 评论(0) 推荐(0)

摘要:The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either fil 阅读全文
posted @ 2019-07-25 13:04 Target--fly 阅读(146) 评论(0) 推荐(0)