[伯俊]10815号:デジタルカード(Python)
質問する
私の答え
n=int(input())#숫자 카드의 개수
arr_n=list(map(int,input().split()))#가지고 있는 숫자
m=int(input())#m의 카드 수
arr_m=list(map(int,input().split()))#m개 카드의 각 숫자
dic= {arr_m[i]: 0 for i in range(len(arr_m))} #딕셔너리의 value를 0으로 초기화
for i in arr_n:
if i in dic:#가지고 있다면 1을 더함
dic[i]+=1
for i in dic.values():#딕셔너리의 value에 접근
print(i, end=' ')
方法Reference
この問題について([伯俊]10815号:デジタルカード(Python)), 我々は、より多くの情報をここで見つけました https://velog.io/@yj_lee/백준-10815번-숫자-카드-파이썬-hmli5c0hテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol