하루일문

[백준] 10816번 숫자 카드 2(파이썬) 본문

algorithm/baekjoon

[백준] 10816번 숫자 카드 2(파이썬)

support_u 2023. 2. 14. 17:36

풀이

import sys
card_n = int(input())
card = list(map(int, sys.stdin.readline().split()))
M = int(input())
s_g = list(map(int, sys.stdin.readline().split()))


from collections import Counter

count = Counter(card)


for i in s_g:
    if i in count:
        print(count[i], end = " ")
    else:
        print(0, end = " ")