#include<iostream>
#include<map>
using namespace std;
map<int,int> mp;
int main()
{
int m,n,color;
scanf("%d%d",&m,&n);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
scanf("%d",&color);
mp[color]++;
}
}
int pMax=-1,pTimes=0;
for(map<int,int>::iterator it=mp.begin();it!=mp.end();it++){
if(it->second>pTimes){
pMax=it->first;
pTimes=it->second;
}
}
printf("%d\n",pMax);
return 0;
}
PAT A 1054 The Dominant Color
最新推荐文章于 2024-02-28 10:43:40 发布