728x90
https://www.acmicpc.net/problem/1764
💡 문제 풀이
자료구조 문제이다.
set에 대한 개념을 알고 있는지 묻고 있다.
✔️ 느낀 점
💻 코드
import sys
n, m = map(int, sys.stdin.readline().split())
a1 = set([sys.stdin.readline().strip() for _ in range(n)])
a2 = set([sys.stdin.readline().strip() for _ in range(m)])
a3 = list(a1&a2)
print(len(a3))
for n in sorted(a3):
print(n)
'문제 풀이 > 백준(BOJ)' 카테고리의 다른 글
[Python] 백준 2096번 : 내려가기 (0) | 2022.07.22 |
---|---|
[Python] 백준 2225번 : 합분해 (0) | 2022.07.21 |
[Python] 백준 2294번 : 동전 2 (0) | 2022.07.19 |
[Python] 백준 2293번 : 동전 1 (0) | 2022.07.18 |
[Python] 백준 7576번 : 토마토 (0) | 2022.07.17 |
댓글