반응형
![백준 온라인 저지](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
[ Contents ]
1. 문제 (링크 참조)
22938번: 백발백준하는 명사수
백발백준은 무슨 과녁이던 백발백중하여 올림픽 금메달보다 따기 어렵다는 대한민국 양궁 국가대표 타이틀을 가지고 있다. 이런 백발백준이 현재 연마하는 스킬이 있는데... 바로 두 과녁을
www.acmicpc.net
2. 문제 풀이
두 원이 겹치는 부분이 존재하는지 판별하는 문제입니다.
3. 코드
import sys
input = sys.stdin.readline
x1, y1, r1 = map(int, input().split())
x2, y2, r2 = map(int, input().split())
d = (x1-x2)**2+(y1-y2)**2
print('YES' if (r1+r2)**2>d else 'NO')
판별식은 (r1+r2)**2 > (x1-x2)**2+(y1-y2)**2 입니다.
![star가 되고나서 Tistory](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
반응형
'Algorithm' 카테고리의 다른 글
[구현/수학] 백준 25600 Triathon - 파이썬(Python) (0) | 2023.03.09 |
---|---|
[구현/수학] 백준 25625 샤틀버스 - 파이썬(Python) (0) | 2023.03.08 |
[구현/수학] 백준 2975 Transations - 파이썬(Python) (0) | 2023.03.06 |
[구현/수학] 백준 18247 겨울왕국 티켓 예매 - 파이썬(Python) (0) | 2023.03.05 |
[구현/수학] 백준 14579 덧셈과 곱셈 - 파이썬(Python) (0) | 2023.03.04 |
댓글