英语翻译4

https://www.luogu.com.cn/problem/CF2A

题目描述

The winner of the card game popular in Berland "Berlogging" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is the winner. The situation becomes more difficult if the number of such players is more than one. During each round a player gains or loses a particular number of points. In the course of the game the number of points is registered in the line "name score", where name is a player's name, and score is the number of points gained in this round, which is an integer number. If score is negative, this means that the player has lost in the round. So, if two or more players have the maximum number of points (say, it equals to mm ) at the end of the game, than wins the one of them who scored at least mm points first. Initially each player has 0 points. It's guaranteed that at the end of the game at least one player has a positive number of points.

输入格式

The first line contains an integer number nn ( 1<=n<=10001<=n<=1000 ), nn is the number of rounds played. Then follow nn lines, containing the information about the rounds in "name score" format in chronological order, where name is a string of lower-case Latin letters with the length from 1 to 32, and score is an integer number between -1000 and 1000, inclusive.

输出格式

Print the name of the winner.

在柏林流行的纸牌游戏Berlogging的获胜者是根据以下规则制定的。在游戏结束时只有一个玩家有最大的分数,他就是获胜者。这样的情况变得更加困难,如果最终获得最大数值的玩家不止一个。在每个回合中,一个玩家获得或失去一定的分数。在游戏过程中分数被登记在name score行中。名字是玩家的名字成绩是玩家在这一回合获得的分数,这个分数是一个整数。如果成绩变为了负数意味着玩家在这一轮中失败了。所以如果在游戏最后有两个及以上的玩家获得了最高分,则谁最先达到这个最高分则谁获胜。最初每位玩家有0分。保证在结束游戏时每位玩家的分数都是正数。

第一行包含一个整数n,n时玩的轮数。接下来n行,每行包含的信息是按时间顺序排列的这一轮的“名字成绩”模板,其中名字是长度为1~32的字符串。成绩是-1000~1000之间的整数。

输出获胜者的名字

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值