1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课内】8.数组2/7-5 点赞.c

31 lines
490 B
C
Raw Normal View History

2024-11-13 02:23:33 +00:00
#include <stdio.h>
int n, k, tag_count[1005], max, max_id;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
scanf("%d", &k);
for (int j = 1; j <= k; j++) {
int x;
scanf("%d", &x);
tag_count[x]++;
}
}
for (int i = 1; i <= 1000; i++) {
if (tag_count[i] >= max) {
max = tag_count[i];
max_id = i;
}
}
printf("%d %d\n", max_id, max);
return 0;
}