#include <stdio.h>
#include <string.h>
int main()
{
int std_num,thg_num,temp;
int std_fid=0,thg_fid=0;
int thg_all[10000];
char*name[5];
scanf("%d %d",&std_num,&thg_num);
for(int i=0;i<thg_num;i++){
scanf("%d",&temp);
thg_all[temp]++;}
for(int i=0;i<std_num;i++){
scanf("%s ",name);
int thg_haf,fir=1;
scanf("%d",&thg_haf);
for(int p=0;p<thg_haf;p++){
scanf("%d",&temp);
if (thg_all[temp]==1){
thg_fid++;
if (fir) {
printf("%s: ",name);
printf("%04d",temp);
fir=0; std_fid++;}
else
printf(" %04d",temp);}
if (!fir&&p==thg_haf-1)
printf("\n");
}}printf("%d %d",std_fid,thg_fid);
return 0;
}
这是一道PAT的练习题,我测试点3怎么都过不去...但是在网上搜,也没人出这个问题....有没有大佬帮我瞅瞅。原题链接在这里https://pintia.cn/problem-sets/994805260223102976/problems/994805263964422144