
[Python] 백준 알고리즘 온라인 저지 1002번 : 터렛 Python3 코드 import math n = int(input()) for _ in range(n): x1, y1, r1, x2, y2, r2 = map(int, input().split()) distance = math.sqrt((x1-x2)**2 + (y1-y2)**2) # 두 원의 거리 (원의방정식활용) if distance == 0 and r1 == r2 : # 두 원이 동심원이고 반지름이 같을 때 print(-1) elif abs(r1-r2) == distance or r1 + r2 == distance: # 내접, 외접일 때 print(1) elif abs(r1-r2) < distance < (r1+r2) : # 두 원이 서로다..
파이썬 스킬업/백준 알고리즘 연습
2020. 7. 23. 21:35
반응형