![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
文章平均质量分 81
ToRe.
这个作者很懒,什么都没留下…
展开
-
POJ 2387 Til the Cows Come Home(最短路)
DescriptionBessie 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 wan...原创 2018-04-04 20:15:17 · 234 阅读 · 0 评论 -
POJ 3169 Layout (差分约束)
DescriptionLike everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The...原创 2018-04-18 13:45:21 · 132 阅读 · 0 评论 -
HDU 4725 The Shortest Path in Nya Graph(优先队列优化 Dijkstra+建图)
Problem DescriptionThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of th...原创 2018-04-18 21:22:59 · 202 阅读 · 0 评论 -
HDU 1385 Minimum Transport Cost(Floyd + 路径输出)
Problem DescriptionThese are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city to an...原创 2018-05-10 10:11:01 · 174 阅读 · 0 评论 -
2010辽宁省赛 NBUT 1221 Intermediary(三进制状压+Dijkstra)
题目链接 题意 给你 nnn 个点 000 到 n−1n-1n−1 ,mmm 个行政人员 000 到 m−1m-1m−1,qqq 条边。 接下来一行 mmm 个整数,代表 eie_iei 接下来一行 mmm 个整数,代表 fif_ifi 接下来 qqq 行,每行 444 个整数,uuu,vvv,zzz,ddd,表示 uuu 到 vvv 有条单向边,归第 zzz 个行政人员管,边权为 ddd 求...原创 2019-04-01 11:38:51 · 164 阅读 · 0 评论 -
CodeForces 449B Jzzhu and Cities(最短路)
题目连接 题意 给你一个由n个点m条边组成的无向图,再给你k条边(起点必为1),再k条边中求最多能删掉几条边,使得1到各个点的最短路大小不变。 思路 Dijkstra 变形,dis数组初始化正无穷,可以直接用k条边先更新dis数组(因为起点必为1),然后将当前所有起点据终点长度不为正无穷的入队(1号点先入队),修改dijkstra中判断,如果当前点是第一次能够缩短,且不为正无穷说明铁路能够舍去。 ...原创 2019-07-22 12:53:02 · 90 阅读 · 0 评论