티스토리 뷰
https://www.acmicpc.net/problem/1764
import sys
N, M = map(int, sys.stdin.readline().split())
A = []
B = []
for i in range(N):
A.append(sys.stdin.readline().rstrip())
for i in range(M):
B.append(sys.stdin.readline().rstrip())
name = sorted(list(set(A) & set(B)))
print(len(name))
for i in range(len(name)):
print(name[i])
'Algorithm > Baekjoon' 카테고리의 다른 글
[백준] 1193 : 분수찾기 - Python (0) | 2020.04.06 |
---|---|
[백준] 2292 : 벌집 - Python (0) | 2020.04.06 |
[백준] 13458 : 시험 감독 - Python (0) | 2020.03.27 |
[백준] 1316 : 그룹 단어 체커 - Python (0) | 2020.03.27 |
[백준] 2941 : 크로아티아 알파벳 - Python (0) | 2020.03.27 |