![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
文章平均质量分 77
GKHack
这个作者很懒,什么都没留下…
展开
-
POJ2502 Subway(Floyd)
Description You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because原创 2015-08-09 08:58:52 · 1075 阅读 · 0 评论 -
数据结构实验3(飞机最少环城次数问题)
使用图算法解决应用问题: 设有n个城市, 编号为0 ~ n - 1, m条航线的起点和终点由用户输入提供. 寻找一条换乘次数最少的线路方案. 使用有向图表示城市间的航线, 只要两城市之间有航班, 则图中这两点间存在一条权为1的边. 用Dijkstra算法实现求最少换乘次数. 在MGraph类中增加Choose函数以及Dijkstra函数即可. 实现代码: #include "iostrea原创 2015-12-13 18:14:17 · 3772 阅读 · 0 评论 -
POJ1062 昂贵的聘礼(dijkstra)
题目链接:点击打开链接 读入数据后,扫一遍物品,每一遍都根据等级关系标记这个物品是否可以使用,进行一次dijkstra,求出最小花费金币数。 AC代码: #include "iostream" #include "cstdio" #include "cstring" #include "algorithm" using namespace std; const int INF原创 2015-10-08 07:39:08 · 955 阅读 · 0 评论 -
HDOJ1874 畅通工程续(floyd)
Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input 本题目包含多组数据,请处理到文件结束。原创 2015-08-09 10:55:25 · 739 阅读 · 0 评论 -
POJ3259 Wormholes(bellman)
Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination a原创 2015-08-09 14:57:28 · 962 阅读 · 0 评论 -
HDOJ1317 XYZZY(floyd + bellman)
Problem Description It has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment原创 2015-08-09 11:09:20 · 1028 阅读 · 0 评论 -
HDOJ066 一个人的旅行(dijkstra)
Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大原创 2015-08-09 11:00:12 · 1139 阅读 · 0 评论 -
HDOJ5317 How Many Maos Does the Guanxi Worth(floyd)
Problem Description "Guanxi" is a very important word in Chinese. It kind of means "relationship" or "contact". Guanxi can be based on friendship, but also can be built on money. So Chinese often s原创 2015-08-09 11:15:46 · 944 阅读 · 0 评论 -
POJ3660 Cow Contest(floyd)
Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill ra原创 2015-08-09 15:25:38 · 932 阅读 · 0 评论 -
POJ3268 Silver Cow Party(dijkstra)
Silver Cow Party Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 15644 Accepted: 7106 Description One cow from each of N farms (1 ≤ N ≤ 1000) convenientl原创 2015-08-31 20:13:00 · 1155 阅读 · 0 评论 -
BestCoder Round #53 (div.2) HDOJ5422 Rikka with Graph(floyd)
Rikka with Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 232 Accepted Submission(s): 124 Problem Description As we know,原创 2015-08-30 15:19:13 · 112 阅读 · 0 评论 -
CSU1256 天朝的单行道(spfa)
1256: 天朝的单行道 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 281 Solved: 92 [Submit][Status][Web Board] Description 在另一个平行宇宙中,有一个神奇的国度名叫天朝。天朝一共有N个城市(标号分别为1, 2, …, N),M条道路,为了方便交通管制,天朝的M原创 2015-12-08 20:27:27 · 770 阅读 · 0 评论