1411 - Word Count
Time Limit : 2 Second
Memory Limit : 128 MB
Give you a list of N words, combine all the identicals, output the words and their appearence times lexicographically.
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.
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
- Hong Zehua, HUST Campus 2010, Preliminary