본문 바로가기
📚 Algorithm

[Python] 백준 14470번 전자레인지

by 뿌맘 2021. 6. 26.
반응형

https://www.acmicpc.net/problem/14470

 

14470번: 전자레인지

JOI 군은 식사 준비를 위해 A℃의 고기를 전자레인지로 B℃까지 데우려고 한다. 고기는 온도가 0℃보다 낮을 때 얼어 있고, 0℃보다 높을 때는 얼어 있지 않다. 온도가 정확히 0℃일 때 고기는 얼어

www.acmicpc.net

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if a < 0:
    time = -a * c + d + b * e
else:
    time = (b - a) * e

print(time)
반응형

댓글