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

Разделы > Сортировка и последовательности > задача:


50754 - Team Standings

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

Задачи раздела

• 50984 - Top m hardworking employees
• 50847 - The first m trains to leave
• 51002 - The most successful classes
• Word Puzzle
• 50740 - Service Time - 1
• 50750 - Service Time - 2
• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 50358 - Series of Odd Numbers
• 50756 - Average of the Nth Student
• 50757 - National Elections - 1
• 50755- Top N Donors - 1
• 50752 - Student Groups
• 50753 - Average of the Nth Student
• 50751 - The biggest Minute
• 50998 - CEN112 Homework, quiz av...

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

Если у вас есть предложения или пожелания по работе 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