随笔分类 -  最短路

摘要:适用 含负权边的有向图的单源最短路径问题 不能处理带负权边的无向图和包含权值总和为负值的回路 数据结构 dist[u] :源点到u的最短路径长度 思路 每次更新dist数组,使得 dist[u] 的含义是从源点到u的经过n条边的最短路径长度 递推公式 $Dist^k[u]=min(dist^{k-1 阅读全文
posted @ 2018-12-30 19:14 TobicYAL 阅读(386) 评论(0) 推荐(0)
摘要:描述 After going through the receipts from your car trip through Europe this summer, you realised that the gas prices varied between the cities you visi 阅读全文
posted @ 2018-12-20 17:35 TobicYAL 阅读(386) 评论(0) 推荐(0)
摘要:描述 FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths ru 阅读全文
posted @ 2018-11-26 19:29 TobicYAL 阅读(239) 评论(0) 推荐(0)
摘要:兔子与星空(10分) 题目内容: 很久很久以前,森林里住着一群兔子。兔子们无聊的时候就喜欢研究星座。如图所示,天空中已经有了n颗星星,其中有些星星有边相连。兔子们希望删除掉一些边,然后使得保留下的边仍能是n颗星星连通。他们希望计算,保留的边的权值之和最小是多少? 输入格式: 第一行只包含一个表示星星 阅读全文
posted @ 2018-11-20 15:41 TobicYAL 阅读(1012) 评论(0) 推荐(0)
摘要:描述 Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exch 阅读全文
posted @ 2018-11-16 18:38 TobicYAL 阅读(251) 评论(0) 推荐(0)