文件名称:whoisthemiddle
介绍说明--下载内容均来自于网络,请自行研究使用
FJ在调查他的奶牛的平均产奶量,他想知道奶牛的产奶量的最中间数,即:一半的奶牛的产奶量比这个中间数多(或者少),另外的一半则刚好相反。
给出一个奇数,表示奶牛的数量N(范围为:1<=N<10000),同时要给出每头奶牛的产奶量,然后找出来最中间的产奶量,这个数也表示大多数的奶牛的产奶量跟这个数差不多。我要做的就是讲输入的这些数进行排序,然后将排序后中间的那个数输出来。
-FJ is surveying his herd to find the most average cow. He wants to know how much milk this median cow gives: half of the cows give as much or more than the median half give as much or less.
Given an odd number of cows N (1 <= N < 10,000) and their milk output (1..1,000,000), find the median amount of milk given such that at least half the cows give the same amount of milk or more and at least half give the same or less.
给出一个奇数,表示奶牛的数量N(范围为:1<=N<10000),同时要给出每头奶牛的产奶量,然后找出来最中间的产奶量,这个数也表示大多数的奶牛的产奶量跟这个数差不多。我要做的就是讲输入的这些数进行排序,然后将排序后中间的那个数输出来。
-FJ is surveying his herd to find the most average cow. He wants to know how much milk this median cow gives: half of the cows give as much or more than the median half give as much or less.
Given an odd number of cows N (1 <= N < 10,000) and their milk output (1..1,000,000), find the median amount of milk given such that at least half the cows give the same amount of milk or more and at least half give the same or less.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
基础强化训练.cpp