题解 | #记票统计#
记票统计
http://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
普通字典
import sys
n=int(input())
name=input().split(' ')
people=int(input())
vote=input().split(' ')
illegal = 0
dic={}
for i in name:
dic[i] = 0
for i in vote:
if i in name:
dic[i] += 1
else:
illegal += 1
for key in dic.keys():
print(key,':',dic[key])
print('Invalid :',illegal)