首页 > 代码库 > L1-034. 点赞

L1-034. 点赞

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;
}

L1-034. 点赞