题解 | #记票统计#b笨办法

记票统计

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

a = int(input())
d = {}
x = input().split()
#print(x)
for i in x:
    d[i]=0
#print(d)
b = int(input())
y = input().split()
#print(y)
cnt = 0
for i in y:
    flag = 1
    if i not in d:
        flag=0
        cnt=cnt+1
    else:
        d[i]=d[i]+1
for i in d:
    print(i,':',d[i])
print('Invalid :',cnt)

全部评论

相关推荐

06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
头顶尖尖的程序员:我也是面了三四次才放平心态的。准备好自我介绍,不一定要背熟,可以记事本写下来读。全程控制语速,所有问题都先思考几秒,不要急着答,不要打断面试官说话。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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