文件名称:NewCountrySide
介绍说明--下载内容均来自于网络,请自行研究使用
在新农村建设中有2个重要的任务就是:乡村公路建设和乡村医院的完善。但是农村公路线长面广,分散在各个地区的各个角落,为了节省资金,设计部门想用最经济的方案完成乡村公路建设和乡村医院的设置。要求:
(1)求使用最少资金使所有乡村都能通路的方案情况(要求输出所有方案,每个方案修建的公路和公路的总长)。
(2)假设乡村之间能建的公路都已建成,现在想造一个乡村医院,问这个医院造在哪个村庄,使所有村庄到该医院的总路程最短。
(3)假设乡村之间能建的公路都已建成,现在要提供一个问路系统,输入两个乡村A和B,系统能显示从A到B的最短通路长度和该通路的路径。
[输入]
从文件输入。
输入的第一行为一个正整数N(2<=N<=100),表示乡村的个数。
第二行到N+1行为乡村名字。
第N+2行为一个正整数M(N<=M<=N(N+1)/2),表示可以修建的乡村公路数。
接下来M行,每行有三个值:X Y Z,分别表示一条公路连接的两个村庄和公路的长度。-There are two important tasks that the new rural construction: rural road construction and improvement of rural hospitals. But rural highways wide long face, scattered in every corner of the various regions, in order to save money, the design department to use the most economical solution to complete the construction of rural roads and rural hospital settings. Requirements: (1) requires the use of a minimum funding so that all can access the programs of rural (required output of all programs, each program to build roads and highways total length). (2) the assumption can be built between the village road have been built, and now want to build a rural hospital, ask the hospital in which the village made so that all the villages to the hospital shortest total distance. (3) Assuming that the road can be built between the villages have been built, and now want to ask the way to provide a system, enter two villages A and B, the system can display the path length of the shortest path A to B,
(1)求使用最少资金使所有乡村都能通路的方案情况(要求输出所有方案,每个方案修建的公路和公路的总长)。
(2)假设乡村之间能建的公路都已建成,现在想造一个乡村医院,问这个医院造在哪个村庄,使所有村庄到该医院的总路程最短。
(3)假设乡村之间能建的公路都已建成,现在要提供一个问路系统,输入两个乡村A和B,系统能显示从A到B的最短通路长度和该通路的路径。
[输入]
从文件输入。
输入的第一行为一个正整数N(2<=N<=100),表示乡村的个数。
第二行到N+1行为乡村名字。
第N+2行为一个正整数M(N<=M<=N(N+1)/2),表示可以修建的乡村公路数。
接下来M行,每行有三个值:X Y Z,分别表示一条公路连接的两个村庄和公路的长度。-There are two important tasks that the new rural construction: rural road construction and improvement of rural hospitals. But rural highways wide long face, scattered in every corner of the various regions, in order to save money, the design department to use the most economical solution to complete the construction of rural roads and rural hospital settings. Requirements: (1) requires the use of a minimum funding so that all can access the programs of rural (required output of all programs, each program to build roads and highways total length). (2) the assumption can be built between the village road have been built, and now want to build a rural hospital, ask the hospital in which the village made so that all the villages to the hospital shortest total distance. (3) Assuming that the road can be built between the villages have been built, and now want to ask the way to provide a system, enter two villages A and B, the system can display the path length of the shortest path A to B,
(系统自动生成,下载前可以参看下载内容)
下载文件列表
新农村
......\adj_matrix_undir_network.h
......\assistance.h
......\Floyd.h
......\prim.h
......\test (1).txt
......\test_prim.cpp
测试数据 新农村
...............\1.in
...............\10.in
...............\2.in
...............\3.in
...............\4.in
...............\5.in
...............\6.in
...............\7.in
...............\8.in
...............\9.in
...............\说明.txt