[백준 알고리즘] 10816번 숫자 카드 2 (Python)
언어, 알고리즘 공부/백준2020. 5. 5. 17:43[백준 알고리즘] 10816번 숫자 카드 2 (Python)

import sys N = int(sys.stdin.readline()) N_list = list(map(int, sys.stdin.readline().split())) N_list.sort() M = int(sys.stdin.readline()) M_list = list(map(int, sys.stdin.readline().split())) hashmap = {} for n in N_list: if n in hashmap: hashmap[n] += 1 else: hashmap[n] = 1 print(" ".join(str(hashmap[m]) if m in hashmap else '0' for m in M_list)) ▼링크 https://www.acmicpc.net/problem/10816 10816..

image