点赞(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;
}

posted @ 2018-03-20 21:35  pprp  阅读(278)  评论(0编辑  收藏  举报