kkm0805p   2년 전

import sys

input=sys.stdin.readline

n=int(input())

arr=list(map(int,input().split()))

m=int(input())

arr2=list(map(int,input().split()))

dic={arr2[i]:0 for i in range(m)}

for i in arr:

if i in dic:

dic[i]+=1

print('  '.join(str(dic[i]) for i in arr2))

이거는 정답인데 출력문은 달라도 결과는 같이 나오는데 뭐가 틀린건가요?

srdyhtty   2년 전

첫번째 코드에는 공백이 두개네요

댓글을 작성하려면 로그인해야 합니다.