CF43A.Football

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

One day Vasya decided to have a look at the results of Berland 1910 Football Championship’s finals. Unfortunately he didn't find the overall score of the match; however, he got hold of a profound description of the match's process. On the whole there are n lines in that description each of which described one goal. Every goal was marked with the name of the team that had scored it. Help Vasya, learn the name of the team that won the finals. It is guaranteed that the match did not end in a tie.

一天,瓦西娅决定查看一下贝尔兰 1910 年足球锦标赛决赛的结果。不幸的是,他没能找到整场比赛的最终比分;不过,他得到了一份关于比赛过程的详细描述。该描述总共包含 nn 行,每行描述了一个进球。每个进球都标注了进球球队的名称。请帮助瓦西娅找出决赛的获胜球队。题目保证比赛没有平局。

输入格式

The first line contains an integer n (1 ≤ n ≤ 100) — the number of lines in the description. Then follow n lines — for each goal the names of the teams that scored it. The names are non-empty lines consisting of uppercase Latin letters whose lengths do not exceed 10 symbols. It is guaranteed that the match did not end in a tie and the description contains no more than two different teams.

第一行包含一个整数 nn(1≤n≤1001 \leq n \leq 100)—— 描述中的行数。接下来是 nn 行,每行对应一个进球,内容为进球球队的名称。球队名称为非空字符串,仅由大写拉丁字母组成,且长度不超过 10 个字符。保证比赛未以平局结束,且描述中至多出现两个不同的球队。

输出格式

Print the name of the winning team. We remind you that in football the team that scores more goals is considered the winner.

输出获胜队伍的名称。我们提醒您,在足球比赛中,进球数更多的队伍被视为获胜方。

输入输出样例

  • 输入#1

    1
    ABC

    输出#1

    ABC
  • 输入#2

    5
    A
    ABA
    ABA
    A
    A

    输出#2

    A

输入解题思路,AI测评打分。不知道怎么写?

首页