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

14322번 - Country Leader (Small) 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB24914913663.256%

문제

The Constitution of a certain country states that the leader is the person with the name containing the greatest number of different alphabet letters. (The country uses the uppercase English alphabet from A through Z.) For example, the name GOOGLE has four different alphabet letters: E, G, L, and O. The name APAC CODE JAM has eight different letters. If the country only consists of these 2 persons, APAC CODE JAM would be the leader.

If there is a tie, the person whose name comes earliest in alphabetical order is the leader.

Given a list of names of the citizens of the country, can you determine who the leader is?

입력

The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line with an interger N, the number of people in the country. Then N lines follow. The i-th line represents the name of the i-th person. Each name contains at most 20 characters and contains at least one alphabet letter.

출력

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the name of the leader.

제한

  • 1 ≤ T ≤ 100.
  • 1 ≤ N ≤ 100.
  • Each name consists of at most 20 characters and only consists of the uppercase English letters A through Z.

예제 입력 1

2
3
ADAM
BOB
JOHNSON
2
A AB C
DEF

예제 출력 1

Case #1: JOHNSON
Case #2: A AB C

힌트

In sample case #1, JOHNSON contains 5 different alphabet letters('H', 'J', 'N', 'O', 'S'), so he is the leader.

Sample case #2 would only appear in Large data set. The name DEF contains 3 different alphabet letters, the name A AB C also contains 3 different alphabet letters. A AB C comes alphabetically earlier so he is the leader.

출처

Contest > Google > Google's Coding Competitions > Google APAC 2017 University Test > Round A APAC Test 2017 A1번

Contest > Google > Kick Start > Google Kick Start 2016 > Round A A1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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