기록하고 까먹지 말기

1269 본문

전공/백준

1269

yha97 2022. 9. 13. 10:21

날짜 : 2022. 09. 13

사용 언어 : python

 

문제

 

 

코드

import sys

m, n = map(int, sys.stdin.readline().split()) # A와 B의 원소의 개수 입력
same = list()
a = dict()
b = dict()

temp_a = map(int, sys.stdin.readline().split())
temp_b = map(int, sys.stdin.readline().split())

for i in temp_a:
    a[int(i)] = 1

for i in temp_b:
    b[int(i)] = 1
    if int(i) in a:
        same.append(int(i))

print(len(a)+len(b)-len(same)*2)

(set 없이 문제 해결)

 

알게된 점

 

 

 

참고 사이트

 

'전공 > 백준' 카테고리의 다른 글

2477  (0) 2022.09.13
11478  (0) 2022.09.13
1764  (0) 2022.09.12
10816  (0) 2022.09.12
14425  (0) 2022.09.10