-
[백준] 1002. 터렛코테 준비/구현 2023. 1. 26. 04:01
import math t=int(input()) for i in range(t): x1,y1,r1,x2,y2,r2=map(int,input().split()) distance=math.sqrt((x1-x2)**2+(y1-y2)**2) #두 원 사이의 거리 if x1==x2 and y1==y2 and r1==r2: #두 원이 일치하는 경우 print(-1) elif r1+r2==distance or abs(r1-r2)==distance: #두원이 한점에서 만나는 경우 print(1) elif r1+r2>distance and abs(r1-r2)<distance: #두원이 두점에서 만나는 경우 (and로 연결) print(2) elif r1+r2<distance or abs(r1-r2)>distance: #두원이 안만나는 경우 print(0)
'코테 준비 > 구현' 카테고리의 다른 글
[백준] 3009. 네번째점 (0) 2023.01.27 [백준] 5430. AC (다시 풀어보기) (0) 2023.01.27 [프로그래머스] 3차 압축 (LZW 알고리즘) (0) 2023.01.26 [프로그래머스] k진수에서 소수 개수 구하기 (0) 2023.01.23 [프로그래머스] 귤 고르기 (0) 2023.01.23