Skill-based Matchmaking
- You are given N players who want to play an M vs M match. Each Player has an attribute Score which is a positive integer.
- The program needs to find possible unique matches of M vs M players depending on their Score. The
- matches should be sorted based on the quality of each match. The quality of the match is defined as the closeness of the scores between the teams.
Example of quality
Let's say we have 1vs1 matches with the following scores-
Match1 100 vs 98
Match2 60 vs 40
Match3 62 vs 64
The sorted order here would be:
Match1, Match3, Match2
For matches with multiple players on one side, the average score should be used.
Input-
Number of players on each side: M
Example-
2
Input-
<name of player 1> <score>
<name of player 2> <score>
A blank line denotes the end of input.
Example-
bleh 85
Aequitas 90
akS 87
lamiV 20
Output-
sorted list of (best to worst)
<comma separated list of players in team A>(average score) vs <comma separated list of players in team
B>(average score)
Example-
bleh,akS (86) vs Aequitas,lamiV (55)
bleh,Aequitas (87.5) vs akS,lamiV (53.5)
bleh,lamiV (52.5) vs Aequitas,akS (88.5)
0 Answer(s)