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

Разделы > Поиск > задача:


51056 - Welcome Picnic

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

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

• 50507 - Sequential Numbers
• 50501 - The Highest Average
• 50434 - Row Min Subtraction
• 50980 - The smallest rectangle
• 50860 - Number of Student Certificates
• 50832 - Rock Paper Scissors Lizard ...
• 50834 - The train which leaves the f...
• 51078 - Max trade
• 51056 - Welcome Picnic
• 51055 - The competition
• 51077 - Grades Histogram
• 51057 - Number of students
• 51046 - The biggest number
• 50535 - Image Compression
• 50450 - Last Appereance of a Number
• 50457 - The Number of Winners
• 50453 - The Cubic Difference

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Q3

The university organizes welcome picnic every year for the freshman students. In the picnic, students are divided into 3 different games: 1: Football, 2: Basketball, 3: Volleyball.

Question: Write a program, that reads the name and preference of n students and defines the game which has the most number of students.

Input specification: you will be given one integer (n) in the beginning. Then, the following n lines will have two strings: The name of the student and his/her preferred game (Football, Basketball or Volleyball) where n is between 1 and 10,000 names are at most 20 char strings containing only 26 English (uppercase or lowercase) letters, and there are only 3 possible games.

Output specification: Show the game which has the most number of participants, and the number of students who play this game. If there are several games with the same number of students, follow the order of games given above.

Sample Input I
5
Erald Basketball
Redi Volleyball
Erida Football
Kei Volleyball
Ardi Basketball
Sample Input II
4
Edra Volleyball
Albi Basketball
Riva Football
Pironada Football
Sample Output I
Basketball 2
Sample Output II
Football 2



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

www.contester.ru