ac代码:
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int n;
cin >> n;
int m, a[1001], propertyTag;
memset(a, 0, sizeof(a));
for(int i=0; i<n; i++)
{
cin >> m;
for(int j=0; j<m; j++)
{
cin >> propertyTag;
a[propertyTag]++;
}
}
int biggest=0;
for(int i=1; i<1001; i++)
{
if(a[i]>=a[biggest])
biggest = i;
}
//cout << "Hello world!" << endl;
cout << biggest << " " << a[biggest];
return 0;
}
时间: 2024-12-28 20:24:42