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;
}

 

posted on 2025-11-23 17:09  王景迁  阅读(3)  评论(0)    收藏  举报

导航