题解 | #记票统计#
记票统计
http://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
while True: try: n = int(input()) candidate = input().split() m = int(input()) ticket = input().split() invalid = 0 vote = {} for i in candidate: vote[i]=0 for i in ticket: if i not in candidate: invalid += 1 else: vote[i] += 1 for i,j in vote.items(): print(str(i)+" : "+str(j)) print('Invalid : '+str(invalid)) except: break