Winner
题目(https://acs.jxnu.edu.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 m) at the end of the game, than wins the one of them who scored at least m 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 n (1  ≤  n  ≤  1000), n is the number of rounds played. Then follow n 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.

样例输入:
3
mike 3
andrew 5
mike 2
样例输出:
andrew
样例输入:
3
andrew 3
andrew 2
mike 5
样例输出:
andrew

翻译:

在波兰,流行卡牌游戏的获胜者"Berlogging"由如下的规则决定:在游戏结束的时候,如果只有一个玩家用拥有最多点数,那么他就是获胜者,如果不止一个玩家有最多点数,情况就变得复杂了。在游戏的每一轮,玩家获得或失去特定的点数,在游戏过程中,玩家获得的点数记录在"name score"那一行,“name“是玩家的名字,”score“是玩家这轮获得的点数,为一个整数。如果score是负数,表示玩家输了这轮游戏。所以,在游戏结束时,如果两个或更多玩家有最多的点数(或者说点数为m),那么获胜者就是那个最早获得m点数的玩家。每个玩家一开始都有0个点数。题目保证在游戏结束时至少有一个玩家的score是正数。

输入:

第一行包含一个整数n(1<=n<=100),n是游戏进行的轮数。接下来n行,每行包含含了对应轮数的"name score",”name“是一个由小写英文字母组成的字符串 长度为1到32,”score“是一个在-1000和1000间的整数。

输出:

打印获胜者的name。

样例输入:
3
mike 3
andrew 5
mike 2
样例输出:
andrew
样例输入:
3
andrew 3
andrew 2
mike 5
样例输出:
andrew

2022.01.02翻译Winner相关推荐

  1. 2022.01.26翻译Watermelon

    Watermelon 题目(https://acs.jxnu.edu.cn/problem/CF4A)描述: One hot summer day Pete and his friend Billy ...

  2. 2022.01.19翻译Ancient Berland Circus

    Ancient Berland Circus 题目(https://acs.jxnu.edu.cn/problem/CF1C)描述: Nowadays all circuses in Berland ...

  3. 2022.01.02 Acwing寒假每日一题 笨拙的手指

    1.题目笨拙的手指 奶牛贝茜正在学习如何在不同进制之间转换数字. 但是她总是犯错误,因为她无法轻易的用两个前蹄握住笔. 每当贝茜将数字转换为一个新的进制并写下结果时,她总是将其中的某一位数字写错. 例 ...

  4. 《安富莱嵌入式周报》第251期:2022.01.31--2022.02.06

    往期周报汇总地址:嵌入式周报 - uCOS & uCGUI & emWin & embOS & TouchGFX & ThreadX - 硬汉嵌入式论坛 - P ...

  5. 《安富莱嵌入式周报》第246期:2021.12.27--2022.01.02

    往期周报汇总地址:嵌入式周报 - uCOS & uCGUI & emWin & embOS & TouchGFX & ThreadX - 硬汉嵌入式论坛 - P ...

  6. 洛谷 刷题 深基部分题解(python版)-2022.01.29

    P5703 [深基2.例5]苹果采购(python3实现) https://blog.csdn.net/dllglvzhenfeng/article/details/122690555 P5703 [ ...

  7. 小学奥数 7657 连乘积末尾0的个数-2022.01.26

    http://noi.openjudge.cn/math/7657/ /* 小学奥数 7657 连乘积末尾0的个数-2022.01.26 http://noi.openjudge.cn/math/76 ...

  8. 1168:大整数加法--2022.01.22 AC

    /* 1168:大整数加法--2022.01.22 AC http://ybt.ssoier.cn:8088/problem_show.php?pid=1168c++中 cin.cin.get().c ...

  9. 1.5 编程基础之循环控制 11 整数的个数(2022.01.09)--python

    http://noi.openjudge.cn/ch0105/11/ """ 1.5 编程基础之循环控制 11 整数的个数(2022.01.09) http://noi. ...

最新文章

  1. 协方差矩阵介绍及C++/OpenCV/Eigen的三种实现
  2. redis 失效时间单位是秒还是毫秒_Redis 事务与过期时间详细介绍
  3. 一款java代码生成器(我受够了加班),走起!
  4. SpringBoot打包时提示:Perhaps you are running on a JRE rather than a JDK?
  5. python 类和对象 有必要学吗_类与对象-python学习19
  6. 如何模块化设计B端系统?
  7. html5 无障碍,[Vue 3] 教程 – 无障碍 – 基础
  8. redis 值字符串前面部分乱码_解决spring boot redis序列化key-value乱码
  9. nagios 飞信(fetion) 短信报警
  10. php微信支付接口开发程序(一)
  11. paip.提升用户体验---高性能web解决 c++ mycp 技术.
  12. node.js 代码加密
  13. java 取系统当前时间_java获取当前系统时间方法
  14. 『常识』印刷纸张尺寸对比表
  15. SQL注入-SQLmap-不同数据库注入
  16. 【机器学习-白板推导系列】学习笔记---支持向量机和主成分分析法
  17. 3*4的方格,有多少个长方形?
  18. ARKit和SceneKit
  19. Matlab rand()函数用法
  20. 关于ESM Flag问题

热门文章

  1. 联想Y510P ubuntu14.10双网卡(网卡双IP设置),双显卡设置
  2. PHP彩信接口开发经验及具体开发实现
  3. 图像几何变换时为何要用到插值算法?_图像超分辨率技术-简介
  4. 体制内拒绝当“烂好人”的实用方法
  5. iScroll5 API速查
  6. iOS_Bug收集(一)
  7. 前端每日实战:84# 视频演示如何用纯 CSS 创作一个极品飞车 loader
  8. Percona-Toolkit系列(20) --- pt-query-digest
  9. 50部世界名著中最经典的那一句话
  10. CSS tricks