22774_N-thLargestValue

2022-5-16 18:22| 发布者: Hocassian| 查看: 29| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506945650100-Problem List-采集的数据-后羿采集器.html

Pro.ID

22774

Title

N-th Largest Value

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22774

AC

40

Submit

65

Ratio

61.54%

时间&空间限制

  • Time Limit: 0/0 MS (Java/Others)     Memory Limit: 0/0 K (Java/Others)
  • 描述

    For this problem, you will write a program that prints the N-th 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.

    输出

    Description

    For this problem, you will write a program that prints the N-th 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.

    Input

    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.

    Output

    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.

    Sample Input

    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

    Sample Output

    1 8
    2 489
    3 931
    4 768

    Hint

    请忽略本题。

    Source

    样例输入

    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

    提示

    请忽略本题。


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部