![](https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
最短路径
以题目为背景,来应用各种最短路径的算法
随意凯
这个作者很懒,什么都没留下…
展开
-
最短路径算法集合
https://www.cnblogs.com/flipped/p/6830073.html转载 2021-04-08 09:25:25 · 144 阅读 · 0 评论 -
POJ Telephone Lines 二分搜索+Dijkstra方法=最小化第k个值
DescriptionFarmer 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.There are N (1 ≤ N ≤ 1,000) forlorn telepho原创 2020-07-25 21:15:23 · 131 阅读 · 0 评论 -
AOJ 2200 Mr. Rito Post Office——floyd+动态dp
这道题做了一天,踩了不少坑。。呜呜呜题目大意快递到了:你是某个岛国(ACM-ICPC Japan)上的一个苦逼程序员,你有一个当邮递员的好基友利腾桑遇到麻烦了:全岛有一些镇子通过水路和旱路相连,走水路必须要用船,在X处下船了船就停在X处。而且岛上只有一条船,下次想走水路还是得回到X处才行;两个镇子之间可能有两条以上的水路或旱路;邮递员必须按照清单上的镇子顺序送快递(镇子可能重复,并且对于重复的镇子不允许一次性处理,比如ABCB的话B一定要按顺序走两次才行)。测试数据有多组:N Mx1 y1 t1原创 2020-05-28 18:32:49 · 410 阅读 · 1 评论 -
POJ 3268 Silver Cow Party——两次Dijkstra求解单源往返的最短路径问题
DescriptionOne 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 requires原创 2020-05-28 09:39:30 · 223 阅读 · 0 评论 -
poj 3259 Wormholes——弗洛伊德判断是否存在负环
DescriptionWhile 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 of F原创 2020-05-27 22:16:37 · 1001 阅读 · 0 评论