团体程序设计天梯赛 L1-034 点赞
#include
using namespace std;
int main()
{
int N,b;
int str[1000][10] = { 0,0 }, arry[10000] = {0,0};
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> b;
for (int j = 0; j < b; j++)
{
cin >> str[i][j];
arry[str[i][j]]++;
}
}
int a, o;
a = str[0][0];
o = arry[str[0][0]];
for (int i = 0; i < 10000; i++)
{
if (arry[i] > o)
{
o = arry[i]; a = i;
}
else if (arry[i] == o && i > a)
a = i;
}
cout << a << ' ' << o;
}
共有 0 条评论