시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 42 | 26 | 25 | 75.758% |
Dave likes to surf on Internet and visit many interesting web sites. He stores addresses of web pages he visited in a file.
Make a program that will help Dave to determine the most often visited domains. Also, the program should find how often Dave visited them.
The first line of input file contains a natural number N, 1 ≤ N ≤ 100, the number of addresses.
Each of the following N lines contains one simplified address. A simplified address may begin with a prefix 'http://
', after which comes one or more words separated with dot ('.
'). That part of an address represents a name of a computer. After that may came a path consisting of character '/
' followed by one or more words also separated with character '/
'. Each word is a sequence of one or more small letters of English alphabet (a–z
). Domain name is the last word in a name of a computer and consists of three characters at most.
Every address will consist of 50 characters at most.
The first line of output file should contain the number of visits to the most often visited domain(s).
The second line should contain all the most often visited domains in any order. Every two domains should be separated by one space character.
3 www.hr/www com http://abc.def.net
1 com hr net
4 http://abc.def http://abc.def.ghi def.ghi/abc http://bea.vis.but.thead.xyz
2 ghi
5 com/put1/put2 http://def.exe my.dad.exe/put nesto.bat http://my.mom.com
2 exe com