1 #include<iostream> 2 #include<climits> 3 #include<cstdio> 4 #include<cstring> 5 using namespace std; 6 7 const int maxn=1000000; 8 int arr[maxn],num[maxn]; 9 10 int main() 11 { 12 int n,maxnum; 13 while(scanf("%d",&n)==1){ 14 memset(num,0,sizeof(int)*n); 15 for(int i=0;i<n;i++){ 16 scanf("%d",&arr[i]); 17 num[arr[i]]++; 18 if(num[arr[i]]>=(n+1)/2) 19 maxnum=arr[i]; 20 } 21 printf("%d ",maxnum); 22 } 23 return 0; 24 }