题解 | 记票统计
n=input()
p=input().split()
n=input()
v=input().split()
c=0
res={i:0 for i in p}
for i in v:
if i not in p:
c+=1
else:
res[i]+=1
for k,v in res.items():
print(f"{k} : {v}")
print(f"Invalid : {c}")
n=input()
p=input().split()
n=input()
v=input().split()
c=0
res={i:0 for i in p}
for i in v:
if i not in p:
c+=1
else:
res[i]+=1
for k,v in res.items():
print(f"{k} : {v}")
print(f"Invalid : {c}")
相关推荐