본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 25278번 Terraforming

by 현장 2024. 12. 11.

-Code

temp, oxy, oce = -30, 0, 0
for _ in range(int(input())):
    type, change = input().split()
    change = int(change[1])

    if type == "temperature":
        temp += change
    elif type == "oxygen":
        oxy += change
    elif type == "ocean":
        oce += change

print("liveable"
      if temp >= 8 and oxy >= 14 and oce >= 9
      else "not liveable")