题解 | #记票统计#
记票统计
http://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
while True:
try:
n, names, total, rotes = int(input()), input().split(), int(input()),input().split()
dic = {k : 0 for k in names}
dic['Invalid'] = 0
for k in rotes:
if k in dic:
dic[k] += 1
else:
dic['Invalid'] += 1
for k in dic:
print(k, ':', dic[k])
except:
break