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

25775번 - Letter Frequency 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB17113311082.090%

문제

The most common consonants in English are R, T, N, S, and L. The most common vowels are E, A, and I. It is definitely fun to find the most common letters.

Given a set of words, find the letter that occurs the most in each position. That is, the most frequent letter at Position 1 when considering all the words, the most frequent letter at Position 2 when considering all the words, etc. If more than one letter is the most frequent for a particular position (i.e., ties for max at that position), print those letters in alphabetical order.

입력

The first input line contains an integer, n (1 ≤ n ≤ 20), indicating the number of words. Each of the next n input lines contains a word. Assume that each word contains 1-30 lowercase letters and it starts in column one.

출력

Print each position and the letter(s) that occur the most in that position, following the format illustrated in Sample Output. Note that each output line starts with a number, immediately followed by a colon (‘:’), followed by a space, followed by a letter. If there are multiple letters for an output line, they are separated by exactly one space.

제한

예제 입력 1

5
this
is
an
example
ink

예제 출력 1

1: i
2: n
3: a i k
4: m s
5: p
6: l
7: e

예제 입력 2

3
this
is
longlonglong

예제 출력 2

1: i l t
2: h o s
3: i n
4: g s
5: l
6: o
7: n
8: g
9: l
10: o
11: n
12: g

힌트

출처

University > University of Central Florida > 2022 Local Programming Contest (Final Round) 3번

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

출처

대학교 대회

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

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