点赞(20 分)
#include<iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <map>
using namespace std;
int bulk[1001];
int n;
int main(){
memset(bulk,0,sizeof bulk);
cin >> n;
int recnum = -1, big = -100;
for(int i = 0;i < n ;i++){
int t;
cin >> t;
for(int i= 0 ; i < t; i++){
int tmp;
cin >> tmp;
bulk[tmp]++;
if(big < bulk[tmp] || (big == bulk[tmp] && recnum < tmp)){
big = bulk[tmp];
recnum = tmp;
}
}
}
cout << recnum << " " <<bulk[recnum] << endl;
return 0;
}
代码改变世界