HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Non-linear Data structures: Map, Set, Priority Queues > problem:


50789 - Number of Cities

Guest
• Discussion of problem (1)

Section problems

• 50386 - Conformity
• 50796 - KNN
• 50795 - Trunk
• 50985 - Books Waiting
• 50995 - Group Average
• 50983 - Course Selection
• 50517 - Confusion Matrix
• 50789 - Number of Cities
• 50993 - Products in store
• 50987 - Very Looong Queue
• 50869 - Birthday Celebration
• 50981 - Top popular m-students
• 50794 - Writing Files Into HDD
• 51000 - Book Index
• 51024 - Total Stock Price
• 51023 - Preparing Keyword Index

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.

Number of Cities

You are having a national contest, and many students are coming from different cities. For advertising the event in the media, organization committee asks the cities lists with the number of participants from every city.

Question: You are given the cities list for n participants. Write a program to prepare the participating cities list with the number of participants from each.

Input specification
You will be given an integer (n) the number of participants where 1 ≤ n ≤ 10,000. Then in the following n lines you will be given n strings where each city name is at most 15 chars long containing only 26 English chars.

Output specification
Show the cities list with the number of participants from each.

Sample Input  
7
Elbasan
Durres
Tirana
Elbasan
Shkoder
Elbasan
Tirana
Sample Output  
Elbasan 3
Durres 1
Tirana 2
Shkoder 1

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

www.contester.ru