Dijkstra&Floyd&Spfa
最短路径算法
love亦菲
业精于勤,荒于嬉;行成于思,毁于随。
展开
-
poj 2240 Arbitrage
Arbitrage Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18606 Accepted: 7855 Description Arbitrage is the use of discrepancies in currency exchange rates t原创 2015-11-20 17:46:03 · 348 阅读 · 0 评论 -
poj 1860 Currency Exchange
Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 23914 Accepted: 8660 Description Several currency exchange points are working in our city.原创 2015-11-19 17:50:39 · 493 阅读 · 0 评论 -
hihocoder #1093 : 最短路径·三:SPFA算法
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 万圣节的晚上,小Hi和小Ho在吃过晚饭之后,来到了一个巨大的鬼屋! 鬼屋中一共有N个地点,分别编号为1..N,这N个地点之间互相有一些道路连通,两个地点之间可能有多条道路连通,但是并不存在一条两端都是同一个地点的道路。 不过这个鬼屋虽然很大,但是其中的道路并不算多,所以小Hi还是希望能够知原创 2015-11-17 23:48:26 · 553 阅读 · 0 评论 -
hdu acm 1869 六度分离
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7250 Accepted Submission(s): 2939 Problem Description 1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为原创 2016-02-10 18:32:44 · 432 阅读 · 0 评论 -
hihocoder #1089 : 最短路径·二:Floyd算法
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 万圣节的中午,小Hi和小Ho在吃过中饭之后,来到了一个新的鬼屋! 鬼屋中一共有N个地点,分别编号为1..N,这N个地点之间互相有一些道路连通,两个地点之间可能有多条道路连通,但是并不存在一条两端都是同一个地点的道路。 由于没有肚子的压迫,小Hi和小Ho决定好好的逛一逛这个鬼屋,逛着逛着,小原创 2015-11-05 21:12:01 · 485 阅读 · 0 评论 -
pat 1087. All Roads Lead to Rome (30)
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each原创 2015-12-21 16:03:09 · 715 阅读 · 0 评论 -
pat 1030. Travel Plan (30)
A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b原创 2015-11-29 20:51:41 · 634 阅读 · 0 评论 -
hdu acm 3790 最短路径问题
Problem Description 给你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时输入结束。原创 2015-11-17 19:32:15 · 498 阅读 · 0 评论 -
poj acm 2387 Til the Cows Come Home
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37305 Accepted: 12701 Description Bessie is out in the field and wants to get back to the barn to get as much sleep as原创 2015-11-05 20:59:58 · 461 阅读 · 0 评论 -
hdu acm 1874 畅通工程续
Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input 本题目包含多组数据,请处理到文件结束。 每组数据第一行包原创 2015-11-04 23:52:32 · 753 阅读 · 0 评论