题解 | #记票统计#

记票统计

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

num = int(input().strip())
table1 = list(map(str,input().strip().split(" ")))
num2 = int(input().strip())
table2 = list(map(str,input().strip().split(" ")))
retable,miscount = {},0
for i in table1:
    retable[i] = 0
for j in table2:
    try:
        retable[j] +=1
    except:
        miscount +=1
for i in table1:
    print(i,':',retable[i])
print(f'Invalid : {miscount}')

全部评论

相关推荐

06-07 19:59
门头沟学院 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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