题解 | #记票统计#
记票统计
http://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
while True:
try:
n1 = int(input())
name = input().split()
n2 = int(input())
vot = input().split()
d = {}
for i in range(len(name)):
d[name[i]] = 0
d['Invalid'] = 0
for i in vot:
if i in d:
d[i] += 1
else:
d['Invalid'] += 1
for i in d:
print(i + ' ' + ':' + ' ' + str(d[i]))
except:
break