HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN109/111_2016_Questions > problem:


HW2. 51056 - Welcome Picnic

CEN109/111_2016_Questions

Start: Dec.07.2016 at 12:37:00 PM
Finish: Dec.07.2016 at 01:42:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (4)

Contest problems

• HW1. 51055 - The competition
• HW2. 51056 - Welcome Picnic
• PE01. 51027 - Download Percentage
• PE02. 51028 - Isosceles Triangles
• PE03. 51029 - Buy Three Items
• PE04. 51030 - Number of Right Tria...
• PE05. 51031 - Convert from Hex to...
• PE06. 51032 - Triangle Property
• PE07. 51033 - Sum of the series
• PE08. 51034 - Area of 3 Shapes

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.

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