0
已解决
陈天宇
资深守护
资深守护
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int a[105],b[1005];
int maxn;
int main(){
int cnt=0;
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
b[a[i]]++;
}
for(int i=0;i<=1004;i++){
if(b[i]>0){
cnt++;
}
}
cout<<cnt<<endl;
for(int i=1;i<=1004;i++){
if(b[i]>maxn){
maxn=b[i];
}
maxn=max(maxn,b[i]);
}
cout<<maxn<<endl;
for(int i=0;i<=1004;i++){
if(b[i]==maxn){
continue;
}else{
if(b[i]>0){
cout<<i<<",";
}
}
}
cout<<maxn;
return 0;
}