题解 | #记票统计#

记票统计

https://www.nowcoder.com/practice/3350d379a5d44054b219de7af6708894

# 20241008
n = int(input())         #候选人
ls = input().split()     #候选人的名字
m = int(input())         #投票的人数
ls1 = input().split()    #投票
c = 0

for i in ls:
    c += ls1.count(i)
    print(i+' : '+str(ls1.count(i)))
print("Invalid : " + str(m-c))


全部评论

相关推荐

02-26 09:15
已编辑
蚌埠学院 golang
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务