Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 다이나믹 프로그래밍
- 그리디
- 그래프 이론
- 플로이드-워셜
- 자료구조
- 분할정복
- 서브쿼리
- DP
- 다시
- 구현
- 해시
- 시뮬레이션
- 누적합
- join
- MST
- 그래프 탐색
- 수학
- 백트래킹
- DFS
- 우선순위큐
- 재귀
- GROUP BY
- 에라토스테네스의 체
- 다이나믹프로그래밍
- 다익스트라
- 크루스칼
- 투포인터
- 브루트포스
- BFS
- 트리
Archives
- Today
- Total
기록하고 까먹지 말기
1269 본문
날짜 : 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 없이 문제 해결)
알게된 점
참고 사이트
-