当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3781:Nth Largest Value

题目描述
For this problem, you will write a program that prints the Nth largest value in a fixed sized array of integers. To make things simple, N will be 3 and the array will always be have 10 decimal integer values.
输入解释
The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set consists of a single line containing the data set number, followed by a space, followed by 10 space separated decimal integers whose values are between 1 and 1000 inclusive.
输出解释
For each data set, generate one line of output with the following values: The data set number as a decimal integer, a space, and the 3rd largest value of the corresponding 10 integers.
输入样例
4 
1 1 2 3 4 5 6 7 8 9 1000 
2 338 304 619 95 343 496 489 116 98 127 
3 931 240 986 894 826 640 965 833 136 138 
4 940 955 364 188 133 254 501 122 768 408
输出样例
1 8
2 489
3 931
4 768

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3781

最后修改于 2020-10-29T07:11:12+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536