最短路
三粉咩
这个作者很懒,什么都没留下…
展开
-
最短路径问题
神/n啊,让我wa了一下午不过spfa很重要的一点是,哪怕一个元素出队了,当他的数值改变时,也要将他在入队最短路径问题Time Limit: 1000MS Memory Limit: 65536KBProblem Description平面上有n个点(n<=100),每个点的坐标均在-10000~10000之间。其中的一些点之间有连线。若有连线,则表示可从一个点到达原创 2018-01-31 16:43:19 · 156 阅读 · 0 评论 -
Extended Traffic
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...原创 2018-08-15 21:13:00 · 356 阅读 · 0 评论 -
Tram
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. ...原创 2018-08-15 10:29:46 · 455 阅读 · 0 评论 -
昂贵的聘礼
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,...原创 2018-08-15 09:58:48 · 279 阅读 · 0 评论 -
Arbitrage
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem DescriptionArbitrage is the use of discrep...转载 2018-08-07 18:53:31 · 1099 阅读 · 0 评论 -
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...原创 2018-08-07 12:34:43 · 165 阅读 · 0 评论 -
Subway
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want ...原创 2018-08-14 21:18:30 · 247 阅读 · 0 评论 -
Wormholes
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...原创 2018-08-07 10:01:52 · 432 阅读 · 0 评论 -
Candies
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the...原创 2018-08-14 14:57:27 · 711 阅读 · 0 评论 -
Frogger
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...原创 2018-07-28 11:23:37 · 1569 阅读 · 0 评论 -
Heavy Transportation
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 cus...原创 2018-07-28 11:15:39 · 933 阅读 · 1 评论 -
Cow Contest
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 un...原创 2018-08-05 10:54:45 · 374 阅读 · 0 评论 -
Silver Cow Party
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 ro...原创 2018-08-05 09:21:06 · 94 阅读 · 0 评论 -
Til the Cows Come Home
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...原创 2018-07-27 17:23:16 · 93 阅读 · 0 评论 -
最短路-floyd
#include <iostream>#include <bits/stdc++.h>#define inf 100000000;using namespace std;void floyd(int mmap[][1200],int n,int m){ int a,b,c,i,j,k; //初始化 for(i=1; i<=n; i++...原创 2018-05-24 20:56:19 · 120 阅读 · 0 评论 -
数据结构实验之图论七:驴友计划
Problem Description做为一个资深驴友,小新有一张珍藏的自驾游线路图,图上详细的标注了全国各个城市之间的高速公路距离和公路收费情况,现在请你编写一个程序,找出一条出发地到目的地之间的最短路径,如果有多条路径最短,则输出过路费最少的一条路径。 Input连续T组数据输入,每组输入数据的第一行给出四个正整数N,M,s,d,其中N(2 <= N <= 500)是城市数目...原创 2018-04-20 21:09:53 · 139 阅读 · 0 评论 -
C--最短路
世纪难题——超内存——此题未解决!!!C--最短路Time Limit: 7000MS Memory Limit: 65536KBProblem Description给出一个带权无向图,包含n个点,m条边。求出s,e的最短路。保证最短路存在。 Input 多组输入。对于每组数据。第一行输入n,m(1接下来m行,每行三个整数,u,v,w,表示u,v之原创 2018-01-31 20:32:56 · 136 阅读 · 0 评论 -
Invitation Cards
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 ...原创 2018-08-13 20:59:11 · 322 阅读 · 0 评论