| ps | |
|---|---|
| 링크 | acmicpc.net/… | 
| 출처 | BOJ | 
| 문제 번호 | 10816 | 
| 문제명 | 숫자 카드 2 | 
| 레벨 | 실버 4 | 
| 분류 | 
 기초  | 
	
| 시간복잡도 | O(n+m) | 
| 인풋사이즈 | n<=500,000, m<=500,000 | 
| 사용한 언어 | Python | 
| 제출기록 | 115084KB / 832ms | 
| 최고기록 | 130124KB / 556ms | 
| 해결날짜 | 2021/07/13 | 
| 태그 | |
"""Solution code for "BOJ 10816. 숫자 카드 2".
- Problem link: https://www.acmicpc.net/problem/10816
- Solution link: http://www.teferi.net/ps/problems/boj/10816
"""
import collections
def main():
    N = int(input())  # pylint: disable=unused-variable
    A = [int(x) for x in input().split()]
    M = int(input())  # pylint: disable=unused-variable
    nums = [int(x) for x in input().split()]
    counter = collections.Counter(A)
    print(*(counter[num] for num in nums))
if __name__ == '__main__':
    main()