![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
wangfy_
这个作者很懒,什么都没留下…
展开
-
PATA 1030
Travel Plan (30)A traveler''s map gives the distances between cities along the highways,together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide...原创 2018-03-31 08:34:54 · 141 阅读 · 0 评论 -
PATA 1018
以下代码全都不对,则良机重写!1018. Public Bike Management (30)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at a...原创 2018-03-31 08:35:04 · 230 阅读 · 0 评论 -
Dijkstra+DFS
初始: G[][]:两点间距离 V[][]:边权 w[]:点权dijkstra生成: d[]:到原点的最短距离 pre[vector<int>]:当前节点在最短路径上的前驱DFS: 遍历当前节点的所有上一个前驱节点,判断他们边权和点权的最优值生成一条最优的路径#include <cstdio>const in...原创 2018-04-20 21:08:37 · 500 阅读 · 1 评论 -
Floyd
// Floyd 求任意两点间的最短路长度 ---------------------------------------------------------// 如果 dis[i][k] + dis[k][j] < dis[i][j];// 则 dis[i][j] = dis[i][k] + disd[k][j];#include <cstdio>#include &l...原创 2018-04-20 21:09:07 · 230 阅读 · 0 评论 -
1003 Emergency (25)
Emergency (紧急时刻).As an emergency rescue(营救) team leader of a city, you are given a special map of your country. The map shows several scattered(分散的) cities connected by some roads. Amount of rescu...原创 2018-05-29 19:06:09 · 306 阅读 · 0 评论