1054. The Dominant Color (20)
#include <iostream>
using namespace std;
int c[100000000];
int main()
{
int m, n;
scanf("%d%d", &m, &n);
int i, j, num, max = 0, res;
for(i = 0; i < n; i++)
{
for(j = 0; j < m; j++)
{
scanf("%d", &num);
c[num]++;
if(c[num] > max)
{
max = c[num];
res = num;
}
}
}
printf("%d\n", res);
system("pause");
return 0;
}
浙公网安备 33010602011771号