728x90
반응형
Bronze III
# 4153 직각삼각형
링크 : https://www.acmicpc.net/problem/4513
4513번: The Neptune Adventure
For each data set in the input, print a single line with the shortest amount of time in minutes it takes to reach the location of the rescue team from your starting location without drowning (if possible). If it is not possible to reach the location of the
www.acmicpc.net
풀이
while True:
li = list(map(int, input().split()))
if li[0]==li[1]==li[2]==0:
break
li = sorted(li)
if li[0]**2 + li[1]**2 == li[2]**2:
print('right')
else:
print('wrong')
후기
- sorted를 통해 입력값 중 가장 큰 값을 li[2]에 위치할 수 있도록 구분한다.
'Algorithm Study > Python' 카테고리의 다른 글
[백준 파이썬] # 11053 가장 긴 증가하는 부분 수열 (복습 필요) (0) | 2022.02.16 |
---|---|
[백준 파이썬] # 2292 벌집 (0) | 2022.02.15 |
[백준 파이썬] # 5622 다이얼 (0) | 2022.02.15 |
[백준 파이썬] # 2480 주사위 세개 (0) | 2022.02.15 |
[백준 파이썬] # 1904 01타일 (0) | 2022.02.15 |