#TCTM6135. Silent Auction
0
Silent Auction
Silent Auction
题目描述
A charity is having a silent auction where people place bids on a prize without knowing anyone else’s bid. Each bid includes a person’s name and the amount of their bid. After the silent auction is over, the winner is the person who has placed the highest bid. If there is a tie, the person whose bid was placed first wins. Your job is to determine the winner of the silent auction. 一家慈善机构正在进行一场拍卖,人们在不知道其他人出价的情况下对奖品进行出价。每份投标书都包括一个人的名字和他们的投标金额。拍卖结束后,出价最高的人就是赢家。如果出现平局,最先出价的人获胜。你的工作是确定拍卖的获胜者。输入格式
The first line of input contains a positive integer N, where 1 ≤ N ≤ 100, representing the number of bids collected at the silent auction. Each of the next N pairs of lines contains a person’s name on one line, and the amount of their bid, in dollars, on the next line. Each bid is a positive integer less than 2000. The order of the input is the order in which bids were placed.第一行输入包含一个正整数 ,其中 ,表示在拍卖中收集的投标数量。 接下来的 行.每一行都包含一个人的名字,在下一行包含他们的出价金额,单位为美元。每个出价都是一个小于 的正整数。输入的顺序是投标的顺序。
输出格式
Output the name of the person who has won the silent auction.输出赢得拍卖的人的姓名。
3
Ahmed
300
Suzanne
500
Ivona
450
Suzanne
2
Ijeoma
20
Goor
20
Ijeoma