| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 124 | 113 | 92 | 93.878% |
For the last couple of years gaming competitions have been very popular at the TU Delft. During every competition, any player can obtain up to $100$ points. However, the administration of these competitions has been absolutely terrible, because the result of every competition was written down on a piece of paper and all these were scattered across the TU Delft. A group of students has managed to find (almost) all of these lists of scores, but they would like to compute the total score of each participant. Given a list of (possibly duplicate) names and their scores, help the students out by creating a list of the total score of each participant, sorted in alphabetic order.
On the first line an integer $1 \leq n \leq 10^5$. On the next $n$ lines, the name (a string containing no spaces) of person $M$ followed by an integer $1 \leq k \leq 100$, the score of $M$ in any arbitrary competition.
The output consists of $m$ lines, where $m$ is the number of unique names in the input. Give in alphabetic order the names of all participants and their total score, separated by a space.
8 Grayson 70 Dante 20 Anton 60 Grayson 73 Grayson 97 Dante 92 Tanisha 56 Grayson 96
Anton 60 Dante 112 Grayson 336 Tanisha 56
8 Alexus 36 Jaxon 80 Hali 12 Shayna 31 Xavier 46 Xavier 17 Jaxon 15 Alexus 85
Alexus 121 Hali 12 Jaxon 95 Shayna 31 Xavier 63