#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
int n;
cin>>n;
char ch[1001];
int index[10];
for(int i=0;i<10;i++)
{
index[i]=0;
}
for(int i=0;i<n;i++)
{
scanf("%s",ch);
for(int j=0;j<strlen(ch);j++)
{
index[ch[j]-'0']++;
}
}
vector<int> v;
int max=-1;
for(int i=0;i<10;i++)
{
if(max==index[i])
{
v.push_back(i);
}
if(max<index[i])
{
v.clear();
max=index[i];
v.push_back(i);
}
}
printf("%d: ",max);
for(int i=0;i<v.size();i++)
{
printf("%d",v[i]);
if(i!=v.size()-1)
printf(" ");
}
}
|
0 | 答案正确 | 1 | 364 | 12/12 |
1 | 答案正确 | 1 | 236 | 2/2 |
2 | 答案正确 | 1 | 364 | 3/3 |
3 | 答案正确 | 1 | 364 | 3/3 |