#include<cstdio>
#include<cstdlib>
#include<cctype>
#include<map>
using namespace std;
int main(){
int n, num, flag;
char str[300], ch;
map<int, int> counts;
map<int, int>::iterator it;
scanf("%d", &n);
while (n--){
num = 0;
scanf("%s", str);
for (int j = 0, k = 0; j < 7; k++){
ch = str[k];
if (isdigit(ch)){
j++;
num = num * 10 + ch - '0';
} else if (isupper(ch)){
j++;
num = num * 10 + (ch - 'A' - (ch > 'Q')) / 3 + 2;
}
}
counts[num]++;
}
flag = 0;
for (it = counts.begin(); it != counts.end(); it++){
if (it->second > 1){
printf("%03d-%04d %d\n", it->first / 10000, it->first % 10000, it->second);
flag = 1;
}
}
if (flag == 0)
printf("No duplicates.\n");
return 0;
}
POJ_1002_487-3279
最新推荐文章于 2021-07-11 10:31:09 发布