0% found this document useful (0 votes)
45 views

Level 2

The document provides instructions for counting the number of wins for each player based on game score data. It explains that a win is counted when a player scores more points than their opponent. Players should be ordered in the output based on their win count, from highest to lowest, with ties broken by lowest player ID. Sample input and output formats are provided.

Uploaded by

Tudor Pricop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Level 2

The document provides instructions for counting the number of wins for each player based on game score data. It explains that a win is counted when a player scores more points than their opponent. Players should be ordered in the output based on their win count, from highest to lowest, with ties broken by lowest player ID. Sample input and output formats are provided.

Uploaded by

Tudor Pricop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

9 of 36 event organizer

Corpo:

Well, you’re not a complete nincompoop,


I’ll give you that.

However, climbing up the ladder


shouldn’t be such an easy endeavour.
Let’s see how well you fare with the next
task.

Task for Level 2:


Count the number of wins!

10 of 36 event organizer
› High scores don’t always mean good players. When two good players go against
each other, the scores will be lower than when a bad player goes against a good
one.
› In order to make the ranking better, we’re going to count number of wins for
each player.
› It’s considered a win for a player if it has scored more points that its opponent.
› There will be no ties present in the dataset.

› Count the number of wins for all players and print them in descending order.
› In case there are players with the same amount of wins, the one with the
lowest player id comes before the others.

11 of 36 event organizer
Input Output

gameCount playerCount playerId winCount


player1Id scorePlayer1 player2Id scorePlayer2 playerId winCount
Format … repeated for each game... … repeated for all players sorted in descending order by winCount …
player1Id scorePlayer1 player2Id scorePlayer2 playerId winCount

gameCount - Integer. Represents the number of games played playerId - Integer.


for this test case winCount - Integer. Amount of wins obtained by the player.
playerCount - Integer. Represents the number of players
involved in this test case.
player1Id - Integer. Id of the first player involved in the
game. player1Id < playerCount.
Types
player1Score - Integer. Number of points obtained by the
first player.
player2Id - Integer. Id of the second player involved in the
game. player2Id < playerCount.
player2Score - Integer. Number of points obtained by the
second player.

9 4 2 4
0 227 1 775 1 3
2 292 3 184 0 2
0 279 3 74 3 0
2 34 3 22
Example 1 926 2 486
0 595 1 856
0 120 3 108
0 25 2 935
0 923 2 968

12 of 36 event organizer
GOOD LUCK
37 of 36 event organizer

You might also like