Helping Out
면접 대비시간 제한1초메모리 제한2048 MB
최대 10^5개의 이름과 점수 쌍이 주어질 때, 각 이름의 점수를 모두 더해 이름을 사전순으로 정렬해 총점과 함께 출력한다.
문제
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 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 . On the next lines, the name (a string containing no spaces) of person followed by an integer , the score of in any arbitrary competition.
출력
The output consists of lines, where 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.