#include <iostream>
using namespace std;
int f[10000];
int main()
{
int n, m, t, k, snum = 0, fsum = 0;
cin >> n>> m;
for (int i = 0; i < m; i++)
{
cin >> t;
f[t] = 1;
}
for (int i = 0; i < n; i++)
{
char name[10];
int flag = 0;
scanf("%s %d", name, &k);
for (int j = 0; j < k; j++)
{
cin >> t;
if (f[t])
{
if (flag == 0)
{
printf("%s:", name);
flag = 1;
}
printf(" %04d", t);
fsum++;
}
}
if (flag)
{
cout << endl;
snum++;
}
}
cout << snum << " " << fsum << endl;
return 0;
}
1072 开学寄语
最新推荐文章于 2020-03-13 16:22:08 发布