最短路
weixin_44705665
这个作者很懒,什么都没留下…
展开
-
POJ 2387 dijkstra +邻接表
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 wants to get b...原创 2019-08-19 15:47:24 · 332 阅读 · 0 评论 -
POJ 1502 MPI Maelstrom(求最短路中的最大值)(dijkstra+邻接表)
BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’s research advi...原创 2019-08-21 20:44:40 · 193 阅读 · 0 评论 -
POJ 1847 火车转弯 dijkstra+邻接表
Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. ...原创 2019-08-21 20:24:01 · 165 阅读 · 0 评论 -
POJ 2240 判断正环(Ford)
Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 Britis...原创 2019-08-21 20:16:32 · 67 阅读 · 0 评论 -
POJ 1860 判断有无正环(Bellman_ford算法)
Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can...原创 2019-08-20 20:56:20 · 103 阅读 · 0 评论 -
HDU 1595 (枚举+最短路,Dijkstra)
Marica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn’t live in the same city, she started preparing for the long journey.We know for every road how m...原创 2019-08-20 19:16:24 · 95 阅读 · 0 评论 -
POJ 3259 Wormholes 判断负圈(Ford)
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 at a time that i...原创 2019-08-20 15:47:23 · 83 阅读 · 0 评论 -
POJ 3660 Cow Contest.(Floyd,传递闭包).
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 rating that is uni...原创 2019-08-20 11:28:40 · 98 阅读 · 0 评论 -
POJ 1797 Heavy Transportation(dijkstra+邻接表)
BackgroundHugo 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 place his cust...原创 2019-08-20 10:16:37 · 91 阅读 · 0 评论 -
POJ 3268 Silver Cow Party (Dijkstra+邻接表)
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) unidirectional (one-way roa...原创 2019-08-19 21:35:24 · 81 阅读 · 0 评论 -
POJ 2223 求最短青蛙距离 dijkstra+邻接表
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists’ sun...原创 2019-08-19 20:20:01 · 123 阅读 · 0 评论 -
HDU 3790 求最短距离及其花费(Dijkstra + 优先队列)
给你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<n<=1000, 0<m<...原创 2019-08-19 19:12:20 · 99 阅读 · 0 评论 -
HDU 2112 字符串+最短路(dijkstra+邻接表)
经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一定要与民...原创 2019-08-22 14:49:03 · 105 阅读 · 0 评论