1003 Emergency-PAT甲级

题目描述

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 rescue teams in each city and the length of each road between any pair of cities are marked on the map. When there is an emergency call to you from some other city, your job is to lead your men to the place as quickly as possible, and at the mean time, call up as many hands on the way as possible.


图论:最短路算法

Floyd算法

多元最短路可以用Floyd算法来解决。基本思路是,考察是否能经过k点,将i到j的距离缩短。储存方法是邻接矩阵。主算法:


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×