QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 2048 MB Puntuación total: 100

#15640. 去年圣诞节

Estadísticas

《Last Christmas》封底,有修改。Epic Records / CBS Records Inc.,维基共享资源公有领域。

没有现场音乐的圣诞市场是不完整的,从玩具木琴上跑调的《铃儿响叮当》("Jingle Bells")到巴赫《圣诞清唱剧》(Christmas Oratorio)的专业演奏,你在这里能找到关于音乐的一切。今年,Jonathan 和 Merle 也想通过演奏圣诞歌曲来赚点钱,但他们甚至无法在选择哪些艺人上达成一致,更不用说选择哪些歌曲了。Jonathan 最喜欢 Mariah Carey,而 Merle 则最喜欢 Goo Goo Dolls 的整张圣诞专辑。

他们决定使用统计数据和以下策略来解决争论。他们收集了 $n$ 张过去的圣诞前十名(top-10)榜单,并统计每个艺人出现的次数。注意,一个艺人可能会在同一张榜单中出现多次。出现次数最多的艺人显然是最好的!如果出现平局,他们会在这些出现次数最多的艺人中,寻找获得第 1 名次数最多的艺人。如果仍然平局,他们会继续在这些艺人中寻找获得第 2 名次数最多的艺人,依此类推。

谁是圣诞季最好的艺人?

输入格式

输入包含:

  • 第一行包含一个整数 $n$($1 \le n \le 100$),表示前十名榜单的数量。
  • 接下来 $n$ 行,每行包含 10 个字符串 $s$($1 \le |s| \le 20$),表示前十名榜单中从第 1 名到第 10 名的艺人的名字。每个名字仅由英文小写字母(a-z)组成。^1

输出格式

输出根据上述规则确定的最佳艺人的名字,如果不存在唯一的最佳艺人,则输出 “tie”。

样例

输入样例 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

输出样例 1

madonna

说明 1

Madonna 和 Wham! 总共都出现了三次,但由于 Madonna 比 Wham! 多获得了一次第 1 名,因此 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

输出样例 2

tie

输入样例 3

2
b a b d e a e a b a
b b b e d a d a a a

输出样例 3

a

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.