文件名称:c
介绍说明--下载内容均来自于网络,请自行研究使用
问题描述
有多个可供选择的村庄坐落在笔直的高速公路旁。高速公路被表示为一个整数轴,每个
村庄有一个整数坐标表示其位置。两个村庄不会在同一个位置。在两个位置之间的距离是其
整数坐标的差的绝对值。
现在要选择一些村庄,在这些村庄里建小学。小学位置的选择应该使每个村庄和离该村
庄最近的小学之间的距离的总和最小。注意小学只能建立在某个村庄,小学的位置视为该村
庄的位置。
实验任务
请你写一个程序,给出的村庄的位置和要建立的小学的数量,计算每个村庄和它最近的
小学之间的距离尽可能少的总和。-Problem Descr iption
There are multiple options villages situated beside the straight highway. Highway axis is represented as an integer, each
The village has a integer coordinates represent its position. Two villages will not be in the same position. The distance between the two positions is its
The absolute value of the difference between integer coordinates.
Now we want to a number of villages, built primary schools in these villages. Select the primary location should make every village and village
The sum of the minimum distance of the nearest village primary school between. Note that can only be built in a village primary school, primary school location deemed village
Location village.
Experimental task
You write a program, given the number of positions to be established villages and primary schools, calculated for each village and its nearest
The distance between the primary minimal sum.
有多个可供选择的村庄坐落在笔直的高速公路旁。高速公路被表示为一个整数轴,每个
村庄有一个整数坐标表示其位置。两个村庄不会在同一个位置。在两个位置之间的距离是其
整数坐标的差的绝对值。
现在要选择一些村庄,在这些村庄里建小学。小学位置的选择应该使每个村庄和离该村
庄最近的小学之间的距离的总和最小。注意小学只能建立在某个村庄,小学的位置视为该村
庄的位置。
实验任务
请你写一个程序,给出的村庄的位置和要建立的小学的数量,计算每个村庄和它最近的
小学之间的距离尽可能少的总和。-Problem Descr iption
There are multiple options villages situated beside the straight highway. Highway axis is represented as an integer, each
The village has a integer coordinates represent its position. Two villages will not be in the same position. The distance between the two positions is its
The absolute value of the difference between integer coordinates.
Now we want to a number of villages, built primary schools in these villages. Select the primary location should make every village and village
The sum of the minimum distance of the nearest village primary school between. Note that can only be built in a village primary school, primary school location deemed village
Location village.
Experimental task
You write a program, given the number of positions to be established villages and primary schools, calculated for each village and its nearest
The distance between the primary minimal sum.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
c
.\cover.c
.\cover.exe
.\cover.o
.\locate.c
.\locate.exe
.\locate.o
.\sum.c
.\xxxzwt.c
.\xxxzwt.exe
.\xxxzwt.o