最短路
mumei314
这个作者很懒,什么都没留下…
展开
-
A - Til the Cows Come Home(spfa,Dijkstra,bellman_ford,DIjkastra优先队列的优化)
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-05-04 18:04:14 · 216 阅读 · 0 评论 -
最短路算法(floyd,基于邻接矩阵的Dijkstra,bellman_ford,spfa,基于优先队列的Dijkstra(时间优化))
Dijkstra算法首先介绍单源最短路问题,单源最单路最经典的算法就是Dijkstra算法。而该算法有两种实现,一种是用邻接矩阵实现,另一种是基于优先队列和邻接表的实现。先理解Dijkstra算法的思想,其实就是贪心思想,每次取未访问的节点中权值最小的点,然后遍历能到的其他未访问的点,进行松弛。该算法主要适用于单源正权图。下面给出Dijkstra基于邻接矩阵的伪代码清除所有点的标...原创 2019-06-04 13:51:23 · 365 阅读 · 0 评论 -
H - Cow Contest (最短路floyd算法)
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...原创 2019-06-04 13:50:11 · 256 阅读 · 0 评论 -
G - MPI Maelstrom (最短路floyd算法)
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-06-04 13:48:07 · 230 阅读 · 0 评论 -
F - Wormholes (负环判断)——spfa,floyd,bellman_ford
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-05-19 13:24:51 · 294 阅读 · 0 评论 -
E - Currency Exchange ——(spfa,bellman_ford)
Several 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...原创 2019-05-19 11:47:13 · 260 阅读 · 0 评论 -
D - Silver Cow Party (逆置矩阵,Dijkstra,bellman_ford,floyd)
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...原创 2019-05-19 11:22:50 · 183 阅读 · 0 评论 -
C - Heavy Transportation (bellman_ford,Dijkstra,spfa)
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-05-17 18:12:41 · 212 阅读 · 0 评论 -
B - Frogger——最短路变形(floyd,spfa,Dijkstra)
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...原创 2019-05-17 17:29:51 · 622 阅读 · 0 评论 -
2019ICPC南京网络赛H题Holy Grail
题目链接:https://nanti.jisuanke.com/t/41305As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to participate in the cruel Holy Grail War which has a re...原创 2019-09-01 22:55:19 · 421 阅读 · 0 评论