01204212/scores
รุ่นแก้ไขเมื่อ 22:28, 23 พฤศจิกายน 2559 โดย Jittat (คุย | มีส่วนร่วม) (หน้าที่ถูกสร้างด้วย ': ''This is part of 01204212'' Write a program that maintains scores for each team in a world-wide game competition. Your program...')
- This is part of 01204212
Write a program that maintains scores for each team in a world-wide game competition.
Your program will read a list of names and additional scores and print out the current score of that team. Initially, every team has score of 0.
เนื้อหา
Input
First line: an integer M, the total number of updates (M <= 1,000,000)
Next 'M lines: a team name which is a string consisting of 'A'-'Z','a'-'z','0'-'9' and '_' of length at most 20 and an additional score which is an integer of value at most 1,000.
Output
For each line of the input, output the current score of that team.
Examples
Input
5 hello 10 world 15 hello 123 Hello 15 Hello-world 100
Output
10 15 133 15 100