
最短路
coldfresh
那我们开始吧
展开
-
道路和航路 (SPFA算法)(Bellman-Ford算法的优化)
最小路算法原创 2017-03-28 13:42:55 · 734 阅读 · 0 评论 -
「Poetize9」升降梯上(tyvj2032)(最短路)
开启了升降梯的动力之后,探险队员们进入了升降梯运行的那条竖直的隧道,映入眼帘的是一条直通塔顶的轨道、一辆停在轨道底部的电梯、和电梯内一杆控制电梯升降的巨大手柄。 Nescafe之塔一共有N层,升降梯在每层都有一个停靠点。手柄有M个控制槽,第i个控制槽旁边标着一个数Ci,满足C1<C2<C3<……<CMC1<C2<C3<……<CMC_原创 2018-05-14 19:44:52 · 1116 阅读 · 0 评论 -
In Touch HDU- 5361(最短路+并查集)
There are n soda living in a straight line. soda are numbered by 1,2,…,n from left to right. The distance between two adjacent soda is 1 meter. Every soda has a teleporter. The teleporter of i-th soda...原创 2018-04-05 14:37:10 · 417 阅读 · 0 评论 -
Intervals POJ - 1201(差分约束)(最短路)
You are given n closed, integer intervals [ai, bi] and n integers c1, …, cn. Write a program that: reads the number of intervals, their end points and integers c1, …, cn from the standard input, ...原创 2018-04-10 17:03:11 · 292 阅读 · 0 评论 -
Deleting Edges HDU - 6026 (最短路)
Little Q is crazy about graph theory, and now he creates a game about graphs and trees. There is a bi-directional graph with n nodes, labeled from 0 to n−1. Every edge has its length, which is a pos...原创 2018-04-07 21:27:47 · 238 阅读 · 0 评论 -
Telephone Lines POJ - 3662(spfa+二分)
Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system....原创 2018-03-22 13:46:09 · 320 阅读 · 0 评论 -
(pat)A1087. All Roads Lead to Rome
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 ...原创 2018-03-10 13:37:26 · 432 阅读 · 0 评论 -
(pat)A1030. Travel Plan
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...原创 2018-03-07 18:29:07 · 222 阅读 · 0 评论 -
(pat)A1003. Emergency
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the l...原创 2018-03-07 14:20:40 · 225 阅读 · 0 评论 -
How Many Maos Does the Guanxi Worth HDU - 5137 (spfa)
“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 say “I don’t have one mao原创 2017-09-21 23:19:40 · 288 阅读 · 0 评论 -
transaction transaction transaction HDU - 6201(spfa变式)
Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named “the Man Who Changed China”. Of course, Kelu原创 2017-09-11 15:08:50 · 343 阅读 · 0 评论 -
Delay Constrained Maximum Capacity Path HDU - 1839(二分+最短路)
Consider an undirected graph with N vertices, numbered from 1 to N, and M edges. The vertex numbered with 1 corresponds to a mine from where some precious minerals are extracted. The vertex numbered wi原创 2017-08-28 14:40:21 · 345 阅读 · 0 评论 -
find the longest of the shortest HDU - 1595(最短路)
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 ma原创 2017-08-26 21:36:36 · 313 阅读 · 0 评论 -
Invade the Mars HDU - 3873(最短路变体)
It’s now the year 21XX,when the earth will explode soon.The evil U.S. decided to invade the Mars to save their lives. But the childlike Marsmen never keeps any army,because war never take place on th原创 2017-09-04 21:27:12 · 435 阅读 · 0 评论 -
Saving James Bond HDU - 1245 (最短路)
This time let us consider the situation in the movie “Live and Let Die” in which James Bond, the world’s most famous spy, was captured by a group of drug dealers. He was sent to a small piece of land a原创 2017-08-26 16:25:38 · 328 阅读 · 0 评论 -
Senior Pan HDU - 6166 (最短路咯)
Senior 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 every time, and selects som原创 2017-08-26 13:22:30 · 563 阅读 · 3 评论 -
【acwing 175】 电路维修(最短路)
达达是来自异世界的魔女,她在漫无目的地四处漂流的时候,遇到了善良的少女翰翰,从而被收留在地球上。翰翰的家里有一辆飞行车。有一天飞行车的电路板突然出现了故障,导致无法启动。电路板的整体结构是一个R行C列的网格(R,C≤500),如下图所示。每个格点都是电线的接点,每个格子都包含一个电子元件。电子元件的主要部分是一个可旋转的、连接一条对角线上的两个接点的短电缆。在旋转之后,它就可以连接另...原创 2019-03-14 21:06:21 · 851 阅读 · 0 评论