File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed
baekjoon/problems/[10816]숫자카드2 Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ """
3+ 문제 이름: 숫자 카드 2
4+ 문제 번호: 10816
5+ 문제 링크: https://www.acmicpc.net/problem/10816
6+ 난이도: Silver IV
7+ 태그: 이분 탐색, 자료 구조, 해시를 사용한 집합과 맵, 정렬
8+ """
9+ import sys
10+ from collections import defaultdict
11+
12+
13+ def input (): return sys .stdin .readline ().rstrip ()
14+
15+
16+ N = int (input ())
17+
18+ cards = map (int , input ().split ())
19+ dic = defaultdict (int )
20+
21+ for n in cards :
22+ dic [n ] += 1
23+
24+ M = int (input ())
25+ nums = map (int , input ().split ())
26+
27+ for n in nums :
28+ print (dic [n ], end = " " )
Original file line number Diff line number Diff line change 1+ ---
2+ file : " 10816.md"
3+ name : " 숫자 카드 2"
4+ src : " https://www.acmicpc.net/problem/10816"
5+ tags :
6+ - 이분 탐색
7+ - 자료 구조
8+ - 해시를 사용한 집합과 맵
9+ - 정렬
10+ done : true
11+ draft : false
12+ level : 7
13+ difficulty : " Silver IV"
14+ date : 2021-11-12
15+ ---
16+
17+ # 숫자 카드 2
18+
19+ ## 풀이 코드
20+
21+ ``` python
22+ import sys
23+ from collections import defaultdict
24+
25+
26+ def input (): return sys.stdin.readline().rstrip()
27+
28+
29+ N = int (input ())
30+
31+ cards = map (int , input ().split())
32+ dic = defaultdict(int )
33+
34+ for n in cards:
35+ dic[n] += 1
36+
37+ M = int (input ())
38+ nums = map (int , input ().split())
39+
40+ for n in nums:
41+ print (dic[n], end = " " )
42+ ```
You can’t perform that action at this time.
0 commit comments