题解 | #记票统计#
记票统计
https://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894
try: n=int(input()) names=input().split() m=int(input()) votes=input().split() res={} for k in names: res[k]=0 res['Invalid']=0 for v in votes: v='Invalid' if v not in names else v res[v]+=1 for k,v in res.items(): print(k,':',v) except Exception as e: print(e)