#TCTM16351. TopYodeller
TopYodeller
TopYodeller
题目描述
A yodel is a wordless song that shifts suddenly from a normal voice to a high, falsetto voice and back. Yodeling, present in many Swiss folk songs, is commonly heard throughout the Alps.The TopYodeller contest invites the world’s best yodellers to compete for a share of 100,000 Swiss Francs, with the best yodeller receiving 50,000 Francs. Each yodeller competes in a series of yodel rounds, and is assigned a score, by the judge, for their performance in the round. To keep the judge impartial, each yodeller is assigned a contestant number. Every yodeller competes in every yodel round. After all the yodel rounds are complete, the yodeller with the highest total score is declared the TopYodeller.
You have been hired by the TopYodeller Contest Co-ordinating Committee (CCC) to write a program which generates a scoreboard so that yodel fans around the world can track the progress of the best yodellers on the Internet.
After each round, each yodeller’s cumulative score is calculated and a rank is assigned. A yodeller’s rank is j+1 if j yodellers have a cumulative score higher than their score.Therefore, there may be multiple yodellers at the same rank.
CCC 举办了约德尔歌手大赛。
n 名参赛选手(编号 1∼n)将进行 k 轮比赛。
在每一轮比赛中,评委会根据每一位选手在当回合的表现给其打分。
将一位选手获得过的所有得分累加起来就可以得到该选手的总得分。
在每一轮比赛结束后,组织方会根据每位选手的总得分排出实时排名,总得分越高的选手排名越靠前。
当 k 轮比赛全部结束后,总得分排名第一的选手将荣获最佳约德尔歌手称号。
如果多人并列第一就都荣获该称号。
给定 n 名选手 k 轮比赛的得分,请你找到最佳约德尔歌手,并输出他的最终总得分以及他在比赛过程中曾获得的最差实时排名。
输入格式
Each test case consists of one TopYodeller competition. The first line of the input contains two integers, n and k; n (2 ≤ n ≤100) represents the number of yodellers in the competition, and k (1 ≤ k ≤ 100) represents the number of yodel rounds in the competition.Yodellers are assigned contestant numbers from 1 to n.
Next in the input are k lines, each line representing a yodel round.
Each line of input representing a yodel round contains n integers. These n integers givethe scores assigned to the n yodellers by the judge. The first integer corresponds to thescore given to yodeller number 1, and so forth. The score assigned to a yodeller in any given round is an integer between −1000 and 1000, inclusive.
第一行包含整数 n,k。
接下来 k 行,每行包含 n 个整数,其中第 i 行第 j 个数表示第 i 轮比赛中第 j 名选手的得分。
输出格式
For the highest-ranked yodeller at the end of the competition, output “Yodeller x is the TopYodeller: score y, worst rank z'' where x is the contestant number, y is their total score after the competition, and z is their worst rank at any time during the competition. If there is a tie for TopYodeller, the output should be one line per winning contestant, listed by increasing competitor number.按照编号从小到大的顺序,每行输出一个荣获最佳约德尔歌手称号的选手信息,格式为 Yodeller x is the TopYodeller: score y, worst rank z,其中 x 为选手编号,y 为选手总得分,z 为选手在比赛过程中曾获得的最差实时排名。
5 2
99 97 100 85 -4
95 97 100 62 1000
Yodeller 5 is the TopYodeller: score 996, worst rank 5