School List
Time limit2sMemory limit1024 MB
Count registrations per school number parsed from each name, then list the numbers of schools with between one and five participants.
- Level
Easy3 of 10
- Topics
- Hash map, String, Implementation
- Solved
- No attempts yet
Problem
When registering for an online olympiad, each participant fills in a form that includes the name of their school. Different participants may write the same school's name differently, for example Физико-математическая школа №18 and ФМШ №18. Digits in a school name appear only in the school number. The number appears exactly once in each name and uniquely identifies the school. A school number is a positive integer without leading zeros.
Write a program for the olympiad website that helps the organizers find the number of schools, and the numbers of those schools, from which between one and five participants registered.
Input
The first line contains one integer (), the number of school names entered by all participants. Each of the next lines contains one school name. A name contains only uppercase and lowercase Latin letters, digits, and spaces, and its length does not exceed 100 characters.
Output
The first line contains one integer , the number of schools with between one and five registered participants. Each of the next lines contains one such school number, in any order.
Hint
In the sample, school 18 has two registered students, school 42 has one, and school 9 has six. So only schools 18 and 42 have between one and five participants.