Răspuns:
Explicație:
#include <iostream>
using namespace std;
int vf[1000001];
int main()
{
int n, m, i, j, maxap, elapmax, num;
cin >> n >> m;
for (i=1; i<=n; ++i)
for (j=1; j<=m; ++j)
{
cin >> num; ++vf[num];
}
maxap=vf[0]; elapmax=0;
for (i=1; i<=1000000; ++i)
{
if (maxap<=vf[i]) { maxap=vf[i]; elapmax=i; }
}
cout << elapmax;
return 0;
}