![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路径
nucleare
这个作者很懒,什么都没留下…
展开
-
最短路径·三:SPFA算法(HihoCoder - 1093)(BELLMAN-FORD队列优化)
描述万圣节的晚上,小Hi和小Ho在吃过晚饭之后,来到了一个巨大的鬼屋!鬼屋中一共有N个地点,分别编号为1..N,这N个地点之间互相有一些道路连通,两个地点之间可能有多条道路连通,但是并不存在一条两端都是同一个地点的道路。不过这个鬼屋虽然很大,但是其中的道路并不算多,所以小Hi还是希望能够知道从入口到出口的最短距离是多少?提示:Super Programming Festival Algorithm...原创 2018-05-17 21:12:08 · 171 阅读 · 0 评论 -
Heavy Transportation POJ1797
Background Hugo 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...原创 2018-05-21 20:48:14 · 119 阅读 · 0 评论 -
最短路径问题 (图论入门+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<10...原创 2018-05-16 20:25:21 · 256 阅读 · 0 评论 -
Idiomatic Phrases Game ZOJ - 2750 (hush + dj/bl)
Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms and...原创 2018-08-09 21:53:48 · 124 阅读 · 0 评论 -
Invitation Cards POJ - 1511 (双向最短路)
n the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They h...原创 2018-08-07 21:38:53 · 152 阅读 · 0 评论 -
Einbahnstrasse HDU - 2923 (SPFA最短路双向)
Einbahnstra e (German for a one-way street) is a street on which vehicles should only move in one direction. One reason for having one-way streets is to facilitate a smoother flow of traffic through ...原创 2018-08-08 10:51:17 · 158 阅读 · 0 评论 -
I - Cow Contest POJ - 3660
I - Cow Contest POJ - 3660 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 c...原创 2019-01-11 13:24:22 · 188 阅读 · 0 评论 -
Stealing Harry Potter's Precious HDU - 4771 (BFS+状态压缩dp)
Stealing Harry Potter's PreciousHDU - 4771 Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back ...原创 2019-03-09 13:18:52 · 195 阅读 · 0 评论 -
Senior Pan HDU - 6166 (两个集合的最短路)
Senior PanHDU - 6166Senior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory problems everyday.The task is simple : ZKC will give Pan a directed graph e...原创 2019-05-03 20:30:48 · 172 阅读 · 0 评论