【最短路】【Usaco2014Open】Dueling GPS's

农夫约翰购买新车时误点了两次额外功能选项,导致车上有两个GPS导航系统,经常给出不同的路线建议。问题在于,确定从他的房子到农场的旅程中,如何使GPS的抱怨次数最小化。地图由N个交叉路口和M条方向道路组成,每个GPS系统对每条道路的行驶时间有不同的估计。目标是找出从1号交叉路口到N号交叉路口的路线,使得两个GPS系统的抱怨总和最小。这个问题可以通过反向构建图并运行最短路径算法来转化为一个经典问题。
摘要由CSDN通过智能技术生成

题目链接

题目描述

Farmer John has recently purchased a new car online, but in his haste he accidentally clicked the "Submit" button twice when selecting extra features for the car, and as a result the car ended up equipped with two GPS navigation systems! Even worse, the two systems often make conflicting decisions about the route that FJ should take.

The map of the region in which FJ lives consists of N intersections (2 <= N <= 10,000) and M directional roads (1 <= M <= 50,000). Road i connects intersections A_i (1 <= A_i <= N) and B_i (1 <= B_i <= N). Multiple roads could connect the same pair of intersections, and a bi-directional road (one permitting two-way travel) is represented by two separate directional roads in opposite orientations. FJ's house is located at intersection 1, and his farm is located at i

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值