Logo
(追記) (追記ここまで)

3277번 - DOMAINS 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB85595273.239%

문제

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.

제한

예제 입력 1

3
www.hr/www
com
http://abc.def.net

예제 출력 1

1
com hr net

예제 입력 2

4
http://abc.def
http://abc.def.ghi
def.ghi/abc
http://bea.vis.but.thead.xyz

예제 출력 2

2
ghi

예제 입력 3

5
com/put1/put2
http://def.exe
my.dad.exe/put
nesto.bat
http://my.mom.com

예제 출력 3

2
exe com

힌트

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2001 > Regional Competition - Juniors 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /