题解 | #记票统计#

记票统计

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}')

全部评论

相关推荐

程序员牛肉:说白了这种弱智少和他辩论就行了。 事情没发生到他身上,当然可以道义凌然的说这是在为社会培养人才了。
投递华为等公司10个岗位
点赞 评论 收藏
分享
自学java狠狠赚一...:骗你点star的,港卵公司,记得把star收回去
点赞 评论 收藏
分享
今天 14:31
南华大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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