Football Standings
Здравейте, може ли малко помощ за сортирането по условието всико се изпълнява а judge 40/100
това е кода ми
https://pastebin.com/ZtMN60Xy
Problem 3. Football Standings
You will be given information about results of football matches. Create a standings table by points. For win the team gets 3 points, for loss – 0 and for draw – 1. Also find the top 3 teams with most scored goals in descending order. If two or more teams are with same goals scored or same points order them by name in ascending order.
The name of each team is encrypted. You must decrypt it before proceeding with calculating statistics. You will be given some string key and the team name will be placed between that key in reversed order.
For example: the key: “???”;
String to decrypt: “kfle???airagluB???gertIt%%” -> “airagluB” -> “Bulgaria”
Also you should ignore the letter casing in the team names. For example:
buLgariA = BulGAria = bulGARIA = BULGARIA
Input / Constrains
On the first line of input you will get the key that will be used for decryption
On the next lines until you receive “final” you will get lines in format:
{encrypted teamA} {encrypted teamB} {teamA score}:{teamB score}
Team scores will be integer numbers in the range [0...231]
League standings: {place}. {TEAM NAME} {points} ... |
Output
- Print the standings table ordered descending by points in format:
Top 3 scored goals: - {team name} -> {goals} - {team name} -> {goals} - {team name} -> {goals} |
Where place is a number in range [1… number of teams].
- Then you should print the top 3 team ordered by goals in descending order in format:
- All team’s names should be uppercase.
- For more clarification, see the examples on the next page.
Examples
Input |
Output |
?? ??ecnarF?? ??kramneD?? 0:0 ..??airagluB??32 ??dnalgnE??gf 3:2 Fg??NIAPS?? fgdrt%#$??YNAMREG??gtr 3:4 ??eCnArF?? >>??yLATi??<< 2:2 final |
League standings: 1. BULGARIA 3 2. GERMANY 3 3. FRANCE 2 4. DENMARK 1 5. ITALY 1 6. ENGLAND 0 7. SPAIN 0 Top 3 scored goals: - GERMANY -> 4 - BULGARIA -> 3 - SPAIN -> 3 |
Input |
Output |
KZL fdKZLairagluBKZL KZLkramneDKZLll 2:0 kzljjjKZLAiRaGluBKZL KZLylATIKZLkk 1:1 KZLkRamnedKZL KZLYlatiKZL 4:4 final |
League standings: 1. BULGARIA 4 2. ITALY 2 3. DENMARK 1 Top 3 scored goals: - ITALY -> 5 - DENMARK -> 4 - BULGARIA -> 3 |