#abc231b. B - Election
B - Election
Score : points
问题陈述
一场选举正在进行中。
个人参与了投票。第 个投票者 投给了名为 的候选人。
找出获得最多票数的候选人的名字。给定的输入保证了存在一个获得最多票数的独特候选人。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
An election is taking place.
people voted. The -th person cast a vote to the candidate named .
Find the name of the candidate who received the most votes. The given input guarantees that there is a unique candidate with the most votes.
Constraints
- is a string of length between and (inclusive) consisting of lowercase English letters.
- is an integer.
- There is a unique candidate with the most votes.
Input
Input is given from Standard Input in the following format:
Output
Print the name of the candidate who received the most votes.
Sample Input 1
5
snuke
snuke
takahashi
takahashi
takahashi
Sample Output 1
takahashi
takahashi
got votes, and snuke
got , so we print takahashi
.
Sample Input 2
5
takahashi
takahashi
aoki
takahashi
snuke
Sample Output 2
takahashi
Sample Input 3
1
a
Sample Output 3
a
update @ 2024/3/10 10:04:35