๋ฌธ์
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=' ')
'๐๏ธ Algorithm > ๐ฉ ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค] [Python] Class2_15829๋ฒ_Hashing (0) | 2022.10.27 |
---|---|
[๋ฐฑ์ค] [Python] Class2_10866๋ฒ_๋ฑ (0) | 2022.10.27 |
[๋ฐฑ์ค] [Python] Class2_2805๋ฒ_๋๋ฌด ์๋ฅด๊ธฐ (0) | 2022.10.27 |
[๋ฐฑ์ค] [Python] Class2_2108๋ฒ_ํต๊ณํ (0) | 2022.10.26 |
[๋ฐฑ์ค] [Python] Class2_1654๋ฒ_๋์ ์๋ฅด๊ธฐ (0) | 2022.10.26 |