![[백준 알고리즘] 10816번 숫자 카드 2 (Python)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FbhuMSj%2FbtqDTGwRA0I%2FAAAAAAAAAAAAAAAAAAAAAAvwZFtNKZsSgxdaYAXm2T0__sl2SeXwuNoql45WanFL%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DggkZxAbEY53e2usy2pl2Qoq%252FuhM%253D)
언어, 알고리즘 공부/백준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..