๐๏ธ Algorithm/๐ฉ ๋ฐฑ์ค
[๋ฐฑ์ค] [Python] Class2_10816๋ฒ_์ซ์ ์นด๋2
Dbswnstjd
2022. 10. 27. 19:06
๋ฌธ์
https://www.acmicpc.net/problem/10816
10816๋ฒ: ์ซ์ ์นด๋ 2
์ฒซ์งธ ์ค์ ์๊ทผ์ด๊ฐ ๊ฐ์ง๊ณ ์๋ ์ซ์ ์นด๋์ ๊ฐ์ N(1 ≤ N ≤ 500,000)์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค์๋ ์ซ์ ์นด๋์ ์ ํ์๋ ์ ์๊ฐ ์ฃผ์ด์ง๋ค. ์ซ์ ์นด๋์ ์ ํ์๋ ์๋ -10,000,000๋ณด๋ค ํฌ๊ฑฐ๋ ๊ฐ๊ณ , 10,
www.acmicpc.net
ํ์ด
# ๋ฐฑ์ค 10816๋ฒ ๋ฌธ์ - ์ซ์ ์นด๋2
from collections import Counter
n = int(input())
card_n = list(map(int, input().split()))
m = int(input())
card_m = list(map(int, input().split()))
card_n = Counter(card_n)
for i in card_m:
print(card_n[i], end=' ')