L1-034 点赞 分数 20
// 6'22"
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
map<int,int> hash;
for(int i = 1; i <= n; ++ i)
{
int k;
cin >> k;
for(int j = 1; j <= k; ++ j)
{
int tmp;
cin >> tmp;
hash[tmp] ++;
}
}
int max = -114514;
int num = -114514;
for(auto h : hash)
{
if(h.second > max || (h.second == max && h.first > num))
{
max = h.second;
num = h.first;
}
}
cout << num << " " << max;
return 0;
}
浙公网安备 33010602011771号