题解 | #记票统计#
记票统计
http://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
while True:
try:
n, names, c, v = int(input()), input().split(" "), input(), input().split(" ")
names.append("Invalid")
d = {name: 0 for name in names}
for i in v:
k = i if i in d else "Invalid"
d[k] += 1
for k, v in d.items():
print(f"{k} : {v}")
except:
break