22153_FootballStars

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

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

Pro.ID

22153

Title

Football Stars

Title链接

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

AC

1

Submit

21

Ratio

4.76%

时间&空间限制

  • Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    In the year 1000000000, football is still very popular all over the world. In the long history of football, there are a lot of football stars. People want to know the top 11 football players within a certain period. Now given a football star list, you are asked to complete this task. Each football star is described as follows: (year, name, ability).

    输入

    The first line contains an integer N ( 1 ≤ N ≤ 50000 ), which is the number of football stars. The next N lines, each describes a football star. 0 ≤ year ≤ 1000000000, name contains less than 15 letters, 0 ≤ ability ≤ 1000000000. You can assume that no two names are the same. Then comes an integer R, which is the number of request. The next R lines, each describes a request. Each request contains two integers x, y ( 0 ≤ xy ≤ 1000000000) .

    输出

    Description

    In the year 1000000000, football is still very popular all over the world. In the long history of football, there are a lot of football stars. People want to know the top 11 football players within a certain period. Now given a football star list, you are asked to complete this task. Each football star is described as follows: (year, name, ability).

    Input

    The first line contains an integer N ( 1 ≤ N ≤ 50000 ), which is the number of football stars. The next N lines, each describes a football star. 0 ≤ year ≤ 1000000000, name contains less than 15 letters, 0 ≤ ability ≤ 1000000000. You can assume that no two names are the same. Then comes an integer R, which is the number of request. The next R lines, each describes a request. Each request contains two integers x, y ( 0 ≤ xy ≤ 1000000000) .

    Output

    For each request, you have to output the name of the top 11 football stars according their ability in decreasing order, if there is a tie, sort them according their years in increasing order. If still a tie, sort them according their names in lexicographic order. If the total number of football star is less than 11, output "XXX" in the remaining lines.

    Print a blank line after each request.

    Sample Input

    5
    1 a 1
    2 b 2
    2 c 6
    5 e 50
    5 d 50
    2
    1 2
    5 5

    Sample Output

    c
    b
    a
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX

    d
    e
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX

    Source

    样例输入

    5
    1 a 1
    2 b 2
    2 c 6
    5 e 50
    5 d 50
    2
    1 2
    5 5

    样例输出

    c
    b
    a
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX

    d
    e
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX
    XXX

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部