포럼
문제 ICPC00235

L. Last Christmas

설명

A Christmas market is incomplete without live music, and you will find everything from out-of-tune renditions of "Jingle Bells" on a toy xylophone to professional arrangements of Bach's Christmas Oratorio. This year, Jonathan and Merle also want to earn some money playing Christmas songs, but they cannot even agree on which artists, let alone which songs. Jonathan likes Mariah Carey best, while Merle loves the whole Christmas album by the Goo Goo Dolls.

They decide to settle the discussion using statistics and the following strategy. They take \(n\) past Christmas top-10 lists and count how often each artist appears. Note that an artist may appear multiple times on the same list. The artist with the highest number of appearances is clearly the best! If there is a tie, they look at the artist with the highest number of number 1 hits among the artists with the highest number of appearances. If there is still a tie, they look at highest number of number 2 hits among those, and so on.

Who is the best artist for the Christmas season?

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(1\leq n \leq 100\)), the number of top-10 lists.
- \(n\) lines, each with \(10\) strings \(s\) (\(1 \leq |s| \leq 20\)), the first names of the artists of the top-10 list from \(1\) to \(10\). Each name only consists of English lowercase letters (a-z).If Madonna does not need a last name, why would other artists need one?

출력 형식

Output the name of the best artist according to the rules described above, or "tie" if there is no unique best artist.

예제 1
입력
3
elton jose bowie eagles elvis wham nat joni bruce minnie
elton madonna wham elvis andy donny madonna aha chuck judy
madonna heart whitney chuck joni wham john yoko nsync stevie
출력
madonna
예제 2
입력
3
maria a b wham c d e f maria wham
wham g h maria i j k l wham m
n o p q r s t u v maria
출력
tie
예제 3
입력
2
b a b d e a e a b a
b b b e d a d a a a
출력
a
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2025

평가 및 의견

L. Last Christmas

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

L. Last Christmas

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8