HEUOJ1001 count

题目:HEUOJ:http://acm.hrbeu.edu.cn/index.php?act=problem&id=1001&cid=18

 

现在发现总是忘记数组初始化,很烦额~~~

 

AC代码:

 

原题目:

count

TimeLimit: 1 Second   MemoryLimit: 32 Megabyte

Totalsubmit: 116   Accepted: 30  

Description

Given a number of strings, can you find how many times a string appear in the input?

Input

The input contains multiple test cases. Each case begins with a integer N(the number of strings you will get, N<=100000), followed by N lines, each consists of a string.

Output

For each test case, print "Case K:" where K is the Kth case. K begins with 1. Then print the times(T) a string appears and the number(M) of strings that appear T times. Don't print T or M where M<=0. The output is ordered by T. The length of each strings won't longer than 20.

Sample Input


5
BBA
BBA
BEA
DEC
CCF

Sample Output


Case 1:
1 3
2 1

Submit Status

posted on 2011-03-27 21:59  江南烟雨hust  阅读(163)  评论(0)    收藏  举报

导航