描述
The cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N <= 2,000) farms (numbered 1…N); Bessie starts at Farm 1. She’ll traverse some or all of the M (1 <= M <= 10,000) two-way roads whose length does not exceed 1,000,000,000 that connect the farms. Some farms may be multiply connected with different length roads. All farms are connected one way or another to Farm 1. Bessie is trying to decide how large a waterskin she will need. She knows that she needs one ounce of water for each unit of length of a road. Since she can get more water at each farm, she’s only concerned about the length of the longest road. Of course, she plans her route between farms such that she minimizes the amount of water she must carry. Help Bessie know the largest amount of water she will ever have to carry: what is the length of longest road she’ll have

博客讲述了在干草危机中,奶牛Bessie需要通过不同长度的双向道路访问所有农场,需携带水量与路程成正比。目标是找到最小的水箱容量,即最长达路线的长度。问题转化为求最小生成树中的最长边。给出的样例解释了如何找出这一最长边。
最低0.47元/天 解锁文章
547

被折叠的 条评论
为什么被折叠?



