Pro.ID22153 TitleFootball Stars Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22153 AC1 Submit21 Ratio4.76% 时间&空间限制描述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 ≤ x ≤ y ≤ 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 ≤ x ≤ y ≤ 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 Sample Output c Source 样例输入5 样例输出c 作者 |