Level 5
Level 5
Corpo:
24 of 36                                                     event organizer
                   Corpo:
25 of 36                                                          event organizer
      ›    Games will now be playable in teams.
      ›    You will be given a list of matches and need to output the rating of all players
           after them.
      ›    A team wins if the sum of the points obtained by its players is more than the
           sum of the points obtained by the other team’s players.
      ›    In case there are players with the same amount of points, the one with the
           lowest player id comes before the others.
26 of 36                                                                         event organizer
      ›    When calculating the rating update, the opponent’s rating is considered to be
           the sum of the opponents’ ratings minus the sum of your teammates’
           ratings.
      ›    For example, if the first team has players A (1200), B(1220), C(1215) and the second
           team has players D(1300), E(1180), F(1200), then the rating of the opponent of A is
           considered to be D + E + F - B - C = 1245
27 of 36                                                                        event organizer
           Input                                                                      Output
           gameCount - Integer. Represents the number of games played for this test   playerId - Integer.
           case                                                                       rating - Integer. ELO rating of the player
           playerCount - Integer. Represents the number of players involved in this
           test case.
           playersPerTeam - Integer. Amount of players in one team
 Types     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 the player is in the first team, otherwise in the
           second team.
           pSi - Integer. The score obtained by the i-th player.
           9   10 2                                                                   2   1059
           2   8815 3 13997 6 4316 9 4545                                             7   1032
           2   9038 6 12056 7 12167 8 20846                                           0   1029
           2   4902 3 7784 4 1839 8 2586                                              6   1001
           0   12817 1 10553 5 4892 9 5265                                            5   1000
Example    0   3671 2 2908 3 1738 9 1537                                              1   993
           1   7630 3 11658 6 15166 7 11231                                           4   984
           2   6634 5 8656 7 3959 8 6783                                              8   969
           1   11290 2 10865 3 7027 8 7490                                            3   968
           1   6022 3 9201 6 20384 7 15095                                            9   953
28 of 36                                                                                                           event organizer
           GOOD LUCK
37 of 36               event organizer