Kazi And The Contest
All submissions for this problem are available.
Kazi has organized a Coding Contest in his college. Contest has multiple rounds, in each round a participant may gain or lose few points. At the end, there is only one participant with the maximum points. In the course of the contest, the number of points is written in the line as
"name points", where name is the participant's name and points is, the number of points is gained.
If the point is negative, this means the participant has lost in the round. If two partcipants have the maximum number of points, then winners is the one who scored at least m points first.
Intially each participant has 0 points. It's guranteed that at the end of the game at least one participant has a positive number of points.
The first line contains an integer N, total number of rounds. Then follow N lines, containing information about the rounds in ""name points" " format in chronological order.
Print the Name of the winner of the Contest.
- 1 ≤ N ≤ 1000
- 'name' is the string of lower case letter 1 ≤ |name| ≤ 32
- -1000 ≤points ≤ 1000
Input: 3 mahi 3 vicky 5 mahi 2 Output: vicky Input: 5 mahi 3 mahi 2 vicky 5 ankit 5 pooja 4 Output: mahi
but vicky scored 5 points first, hence the winner.
|Tags||implementation, maps, simple, vicky002|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions