1002 - Country Roads    PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB 点击打开链接 I am going to my home. There are many cities and many…
题目连接: http://www.lightoj.com/volume_showproblem.php?problem=1002 题目描述: 有n个城市,从0到n-1开始编号,n个城市之间有m条边,中心城市为t,问每个城市到中心城市的最小路径的花费,路径花费大小的定义为:一条路上花费最大的边的值. 解题思路: Dijkstra的变形,用Dijkstra求出来的单源路径可以保证每条边都是最优的,所以最短路上的最长边就是所求. #include <algorithm> #include <i…
1002 - Country Roads I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of my city t where I belong. Now…
1087 All Roads Lead to Rome (30)(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 input file co…
本文主要是将我对于我对于迪杰斯特拉算法的理解写出来,同时通过例题来希望能够加深对于算法的理解,其中有错误的地方希望大家指正. 迪杰斯特拉算法 我将这个算法理解成一个局部到整体的算法,这个方法确实越研究就会发现越经典. 首先可以将整个图的节点看成两个集合:一个是S,一个是U-S.如果是求v0到图中各点的最短距离的话,那么S就是已经确认到v0距离最短的点,U-S则是对于整体的点集合U,还没有加入S集合的点. 这里提出一个算法总体的思想,将所有的点按照一定的原则加入到S集就是解集.而这个解法就是重点了…
一个人的旅行 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 23396    Accepted Submission(s): 8142 Problem Description 尽管草儿是个路痴(就是在杭电待了一年多,竟然还会在校园里迷路的人,汗~),但是草儿仍然非常喜欢旅行,由于在旅途中 会遇见非常多人(白马王子,^0^),非常多事,…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=3339 In Action Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7869    Accepted Submission(s): 2674 Problem Description Since 1945, when the first…
find the longest of the shortest Time Limit: 1000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2702    Accepted Submission(s): 974 Problem Description Marica is very angry with Mirko because he found a new gi…
In Action Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5102    Accepted Submission(s): 1696 Problem Description Since 1945, when the first nuclear bomb was exploded by the Manhattan Project t…
Bumped! 题目链接(点击) Peter returned from the recently held ACM ICPC World Finals only to find that his return flight was overbooked and he was bumped from the flight! Well, at least he wasn't beat up by the airline and he's received a voucher for one fre…