hzCPPOJ

排序综合——7、字符串计数

时间限制:  1 s      内存限制:   128 MB
提交:21     正确:9     分值:98

题目描述

给出m个字符串,要求输出重复出现n次的字符串有几个。

输入

先给顶一个N,N<=100000,接着输入N个字符串。

输出

对于每组测试数据,输出若干行,每行两个正整数,第一个数表示重复的次数,第二个数表示在此重复次数下有几种不同的字符串。

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.

样例

样例输入:
5 BBA BBA BEA DEC CCF
样例输出:
Case 1: 1 3 2 1

来源/分类