最短路
Lyang0.0
这个作者很懒,什么都没留下…
展开
-
A - Til the Cows Come Home (优先队列 + 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-07-27 21:19:42 · 161 阅读 · 0 评论 -
SDUT-数据结构实验之图论十一:AOE网上的关键路径(最短路 字典序)
题目描述一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。AOE(Activity On Edge)网:顾名思义,用边表示活动的网,当然它也是DAG。与AOV不同,活动都表示在了边上,如下图所示:如上所示,共有11项活动(11条边),9个事件(9个顶点)。整个工程只有一个开始点和一个完成点。即只有一个入度为零的点(源点)和只有一个出度为零的点(汇点)...原创 2019-01-18 11:15:43 · 247 阅读 · 1 评论 -
SDUT - Heavy Transportation(最短路 disjkstra)
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-01-22 11:22:12 · 119 阅读 · 0 评论 -
SDUT - Silver Cow Party(最短路 disjkstra)
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-01-22 11:25:56 · 106 阅读 · 0 评论 -
SDUT-Wormholes(Floyd判断负环)
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-01-22 11:31:00 · 190 阅读 · 0 评论 -
SDUT- Invitation Cards(最短路 spfa)
In 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 ...原创 2019-01-22 20:27:39 · 135 阅读 · 0 评论 -
SDUT-Extended Traffic(spfa判断负环)
Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destinat...原创 2019-01-23 20:05:47 · 120 阅读 · 0 评论 -
SDUT-昂贵的聘礼(最短路 spfa)
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:“嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,...原创 2019-01-23 20:10:51 · 118 阅读 · 0 评论 -
SDUT- MPI Maelstrom(最短路)
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-01-23 20:19:39 · 162 阅读 · 0 评论 -
SDUT-数据结构实验之图论七:驴友计划(最短路 Floyd)
题目描述做为一个资深驴友,小新有一张珍藏的自驾游线路图,图上详细的标注了全国各个城市之间的高速公路距离和公路收费情况,现在请你编写一个程序,找出一条出发地到目的地之间的最短路径,如果有多条路径最短,则输出过路费最少的一条路径。输入连续T组数据输入,每组输入数据的第一行给出四个正整数N,M,s,d,其中N(2 <= N <= 500)是城市数目,城市编号从0~N-1,M是城市间高速...原创 2019-01-17 14:49:31 · 172 阅读 · 0 评论