백준 10816번 파이썬
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")