最短路
CHEN_XU_LING
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
O - Extended Traffic
O - Extended TrafficDhaka 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 destination, the city authority has made a原创 2020-11-29 10:25:26 · 145 阅读 · 0 评论 -
N - Tram
N - TramTram 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. When the tram enters the intersection it can l原创 2020-11-29 09:47:21 · 169 阅读 · 0 评论 -
J - Invitation Cards
J - Invitation CardsIn 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 have printed invitation cards with原创 2020-11-26 21:02:17 · 242 阅读 · 0 评论 -
I - Arbitrage
I - ArbitrageArbitrage 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 British pound, 1 British pound buys 10.0 French原创 2020-11-20 16:33:51 · 399 阅读 · 0 评论 -
F - Wormholes(AC代码+求改正问题代码)!!!大佬救救孩子
F - WormholesWhile 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 is BEFORE you entered the wormhole! Each o原创 2020-11-19 19:48:47 · 209 阅读 · 0 评论 -
G - MPI Maelstrom
G - MPI MaelstromBIT 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 advisor, Jack Swigert, has asked her to b原创 2020-11-19 19:01:42 · 221 阅读 · 0 评论 -
M - 昂贵的聘礼
M - 昂贵的聘礼年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他可以降低价格。探险家于是又跑到其他地方,其他人也提出了类似的要求,或者直接用金币换,或者原创 2020-11-18 19:43:00 · 209 阅读 · 0 评论 -
E - Currency Exchange
E - Currency ExchangeSeveral 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 be several points specializing i原创 2020-11-16 19:35:44 · 744 阅读 · 0 评论 -
傻瓜也能看懂的Floyd(弗洛伊德算法)!!!!!!!!!!!!!!!!!
暑假,小哼准备去一些城市旅游。有些城市之间有公路,有些城市之间则没有,如下图。为了节省经费以及方便计划旅程,小哼希望在出发之前知道任意两个城市之前的最短路程。上图中有4个城市8条公路,公路上的数字表示这条公路的长短。请注意这些公路是单向的。我们现在需要求任意两个城市之间的最短路程,也就是求任意两个点之间的最短路径。这个问题这也被称为“多源最短路径”问题。现在需要一个数据结构来存储图的信息,我们仍然可以用一个4*4的矩阵(二维数组e)来存储。比如1号城市到2号城市的路程为2,则设e[1][2]的值为2.转载 2020-11-15 15:41:58 · 602 阅读 · 2 评论 -
B - Frogger
B - FroggerFreddy 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’ sunscreen, he wants to avoid swimming and inst原创 2020-11-15 14:54:06 · 161 阅读 · 0 评论 -
D - Silver Cow Party
D - Silver Cow PartyOne 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 roads connects pairs of farms; road i原创 2020-11-14 15:43:19 · 175 阅读 · 0 评论 -
C - Heavy Transportation
C - Heavy TransportationBackgroundHugo 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 customer has build his giant steel原创 2020-11-13 22:05:12 · 207 阅读 · 0 评论 -
A - Til the Cows Come Home
A - Til the Cows Come HomeBessie 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 back as quickly as possible.原创 2020-11-13 20:43:10 · 371 阅读 · 0 评论
分享