백준 풀이

백준 10816번 파이썬

ag2개발자 2022. 8. 30. 14:25
n1=int(input())
n=list(map(int,input().split()))
n2=int(input())
m=list(map(int,input().split()))
hash={}

for i in n:
    if i in hash:
        hash[i]+=1
    else:
        hash[i]=1
for i,j in enumerate(m):
    if j in hash:
        if i!=n2-1:
            print(str(hash[j]), end=' ')
        else:
            print(str(hash[j]))
    else:
        if i!=n2-1:
            print("0",end=" ")
        else:
            print("0")

'백준 풀이' 카테고리의 다른 글

백준 9663번 파이썬 (백트래킹 기초)  (0) 2022.08.30
백준 4949번 파이썬  (0) 2022.08.30
백준 15652번 파이썬  (0) 2022.08.30
백준 15651번 파이썬  (0) 2022.08.30
백준 1541번 파이썬  (0) 2022.08.30