## CCC '04 S2 - TopYodeller

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Problem type
##### Canadian Computing Competition: 2004 Stage 1, Senior #2

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 if yodellers have a cumulative score higher than their score. Therefore, there may be multiple yodellers at the same rank.

#### Input Specification

Each test case consists of one TopYodeller competition. The first line of the input contains two integers, and ; represents the number of yodellers in the competition, and represents the number of yodel rounds in the competition.

Yodellers are assigned contestant numbers from to .

Next in the input are lines, each line representing a yodel round.

Each line of input representing a yodel round contains integers. These integers give the scores assigned to the yodellers by the judge. The first integer corresponds to the score given to yodeller number , and so forth. The score assigned to a yodeller in any given round is an integer between and , inclusive.

#### Output Specification

For the highest-ranked yodeller at the end of the competition, output Yodeller x is the TopYodeller: score y, worst rank z where is the contestant number, is their total score after the competition, and 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.

#### Sample Input

5 2
99 97 100 85 -4
95 97 100 62 1000

#### Sample Output

Yodeller 5 is the TopYodeller: score 996, worst rank 5

#### Explanation of Sample Output

##### After Round 1

Yodeller 3 has score 100, and is ranked 1.
Yodeller 1 has score 99, and is ranked 2.
Yodeller 2 has score 97, and is ranked 3.
Yodeller 4 has score 85, and is ranked 4.
Yodeller 5 has score -4, and is ranked 5.

##### After Round 2

Yodeller 5 has score 996, and is ranked 1.
Yodeller 3 has score 200, and is ranked 2.
Yodeller 1 has score 194, and is ranked 3.
Yodeller 2 has score 194, and is ranked 3.
Yodeller 4 has score 147, and is ranked 5.

• commented on Jan. 16, 2022, 4:26 p.m.

Could somebody possibly let me know why my 4th test is incorrect?

• commented on Jan. 17, 2022, 7:59 p.m.

This comment is hidden due to too much negative feedback. Show it anyway.

• commented on Aug. 7, 2021, 4:39 p.m.

whoops I didn't realize we were ranking the cumulative score

• commented on Feb. 15, 2022, 9:16 a.m.

dang

• commented on Jan. 18, 2021, 5:44 p.m.

What if there is a tie for the worst rank?

• commented on Feb. 18, 2021, 7:01 p.m.

A yodeller's rank is j+1 if j yodellers have a cumulative score higher than their score.

• commented on July 10, 2020, 5:00 p.m.

If there is a tie for TopYodeller, the output should be one line per winning contestant, listed by increasing competitor number.