Level 6
Level 6
Corpo:
30 of 36                                                   event organizer
           Corpo:
31 of 36                             event organizer
           Corpo:
32 of 36                                                    event organizer
      ›    For the last level you’ll be the matchmaker.
      ›    You will be given a list of players that want to play again. Your task is to group them
           in teams and put them in games against each other.
            ›   In any game, the difference between the lowest rating and the highest rating
                has to be less or equal to than a given threshold.
› Your goal will be to get a score less than or equal to another given threshold.
33 of 36                                                                             event organizer
      ›    The score you get for one game is given by the absolute difference between the
           team ratings.
      ›    The score for the whole answer is the sum of the scores for each game that you
           matchmake.
› Example:
› If you match A (1700) and B(1600) against C(1650) and D(1670), the score is 20.
34 of 36                                                                            event organizer
           Input                                                                             Output
           gameCount - Integer. Represents the number of games played for this test case     pIdi - Integer. Player Id.
                                                                                             If i < playersPerTeam, player belongs to first team
           playerCount - Integer. Represents the number of players involved in this test     Otherwise player is in the second team.
           case.
           playersPerTeam - Integer. Amount of players in one team
           n - Integer. Amount of players in one game. 2*playersPerTeam
           pIdi - Integer. Id of the i-th player from one game. If i < playersPerTeam then
Types      the player is in the first team, otherwise in the second team.
           pSi - Integer. The score obtained by the i-th player.
           maxEloDifference - Integer. Max difference between to players in the same game
           scoreThreshold - Integer. Get below this score and pass this level.
           queueSize - Integer. # of players that queued again
           qPi - Integer. Id of the i-th player that queued
35 of 36                                                                                                             event organizer
           Input                               Output
           9 9 2                               6 8 7 4
           2 11840 4 13422   7 1204 8 1865     5 1 2 0
           2 14162 4 16055   5 14386 7 15941
           2 13441 3 16987   4 20732 6 18352
           0 13458 1 14146   3 18889 5 12225
           0 13671 1 14370   2 14906 7 13510
           0 8996 3 9075 6   15877 8 22216
           0 6780 2 5412 3   4018 8 4464
           0 7169 1 7535 2   9969 7 9036
           0 4849 1 5097 2   19284 6 19351
Example
           90 24
           8
           0
           1
           2
           4
           5
           6
           7
           8
36 of 36                                                 event organizer
           GOOD LUCK
37 of 36               event organizer