ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


220. 50754 - Team Standings

Гость
• Вопросы к жюри (1)

Задачи сборника

• 160. 50301 - Fractions to Decimals
• 165. 50360 - National Elections
• 170. 50319 - Toll Plazas
• 180. 50755- Top N Donors - 1
• 185. 50784 - Top Growing Company
• 190. 50734 - Product Info (In Srt)
• 200. 50290 - Minimax Sum
• 210. 50361 - Align Two Lists
• 220. 50754 - Team Standings
• 230. 50286 - Remove Duplicates
• 250. 50448 - Paint Buckets
• 280. 50477 - Character Pyramids

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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