Word Count
Time Limit : 2 Second
Memory Limit : 128 MB
Submission: 415
Solved: 134
- Description
Give you a list of N words, combine all the identicals, output the words and their appearence times lexicographically.
- Input
Only one case.
First line is the number of words N(1<=N<=1000).
Next N lines, each has a word, only contain lower case letters. The length of each is less than 20.
- Output
Order the word lexicographically, each unique word just output once.
For each word output in a line, the word, a blank, the appearence times of the word in the list.
- sample input
-
6 ll erbao ahanhan erbao llswife aha
- sample output
-
aha 1 ahahan 1 erbao 2 ll 1 llswife 1
- hint
- source
- Hong Zehua, HUST Campus 2010, Preliminary