HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Homeworks 2013-2015 > problem:


50754 - Team Standings

CEN112 Homeworks 2013-2015

Start: Dec.15.2013 at 12:00:00 PM
Finish: Dec.15.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 50530 - Sum of Ratios
• 50375 - Area of Circles
• 50388 - Number of Armstrong Num...
• 50393 - Palindromic Numbers
• 50339 - The Largest Rectangle
• 50345 - Orders
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 12-Spr1-40. 50327 - Parallel Lines
• 13-Fall2-20. 50395 - Page "Like" Av...
• 14-Spr1-30. 50492 - Contest Score...
• 14-Spr1-40. 50538 - Sum of kth Dia...
• 14-Spr1-60. 50647 - Spiral
• 14-Spr2-20. 50442 - Polynomial Add...
• 14-Spr2-40. 50361 - Align Two Lists
• 14-Spr2-50. 50616 - Snake

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Team Standings

Question:
Turkish National Football association wants to prepare an automatic system to calculate the team standings. The system is going to read the results of matches, then it will prepare the team standings.

If a team scores more goals than the other team, it wins the match and gets 3 points. If they have equal number of goals, then the match is draw and both teams get one points.

Input specification
You will be first given two numbers; the number of teams (n) and the number of matches played (m) where 2 ≤ n ≤ 20 and 1 ≤ m ≤ 200. The following n lines give the team names, and then the following m lines list the played matches.

Output specification
Show all teams in descending order according to their points. If two teams have the same points show them according team names (in increasing order).

Sample Input I
8 6
Besiktas
Bursaspor
Eskisehirspor
Fenerbahce
Galatasaray
Gaziantepspor
Genclerbirligi
Trabzonspor
Galatasaray Fenerbahce 3 2
Trabzonspor Besiktas 2 2
Bursaspor Genclerbirligi 0 0
Eskisehirspor Gaziantepspor 2 3  
Galatasaray Trabzonspor 1 0
Fenerbahce Besiktas 1 0
Sample Input II
6 6
Besiktas
Konyaspor
Karabukspor
Fenerbahce
Galatasaray
Sivasspor
Besiktas Konyaspor 3 1
Karabukspor Fenerbahce 2 2  
Galatasaray Sivasspor 3 0
Besiktas Karabukspor 2 3
Konyaspor Sivasspor 2 2
Fenerbahce Galatasaray 0 1
Sample Output I
Galatasaray 6
Fenerbahce 3
Gaziantepspor 3
Besiktas 1
Bursaspor 1
Genclerbirligi 1
Trabzonspor 1
Eskisehirspor 0
Sample Output II
Galatasaray 6
Karabukspor 4
Besiktas 3
Fenerbahce 1
Konyaspor 1
Sivasspor 1


Для отправки решений необходимо выполнить вход.

www.contester.ru