#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
vector<int> input;
int n=0;
cin>>n;
for(int i=0;i<n;i++){
int m=0;
cin>>m;
input.push_back(m);
}
long max=0;
int res=-1;
for(int i=0;i<n;i++){
int m=input[i];
long tot=count(input.begin(),input.end(),m);
if(tot==max){
if(input[i]<res||res==-1){
res=input[i];
}
}
if(tot>max){
max=tot;
res=input[i];
}
}
cout<<res<<endl;
}
04-17
03-20
858
08-20
474
08-15
425
08-01
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交