![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
星星的泪痕
这个作者很懒,什么都没留下…
展开
-
A - Til the Cows Come Home
点击打开链接 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wa原创 2017-08-08 11:05:58 · 140 阅读 · 0 评论 -
C - Heavy Transportation
点击打开链接 Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the原创 2017-08-09 08:33:07 · 177 阅读 · 0 评论 -
D - Silver Cow Party
点击打开链接 One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirection原创 2017-08-09 08:34:27 · 220 阅读 · 0 评论 -
K - 最短路
点击打开链接 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M(N 输入保证至少存在1条商店到赛场的路线。 Output对于每组输入,输出一行,原创 2017-08-09 08:35:43 · 1274 阅读 · 0 评论 -
L - 畅通工程续
点击打开链接 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input本题目包含多组数据,请处理到文件结束。 每组数据第一行包含两个正整数N和M(0原创 2017-08-09 08:36:58 · 166 阅读 · 0 评论 -
M - 最短路径问题
点击打开链接 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1 Outp原创 2017-08-10 16:23:17 · 430 阅读 · 0 评论