From 615c87cff590ff53034e622d46e3017004e5864b Mon Sep 17 00:00:00 2001 From: Leewodls Date: Sun, 11 May 2025 21:40:24 +0900 Subject: [PATCH] =?UTF-8?q?Create=20=EB=A7=88=EB=B2=95=EC=9D=98=EC=97=98?= =?UTF-8?q?=EB=A6=AC=EB=B2=A0=EC=9D=B4=ED=84=B0.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...246\254\353\262\240\354\235\264\355\204\260.py" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "\354\235\264\354\236\254\354\235\270/\355\224\204\353\241\234\352\267\270\353\236\230\353\250\270\354\212\244/7\354\243\274\354\260\250/\353\247\210\353\262\225\354\235\230\354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.py" diff --git "a/\354\235\264\354\236\254\354\235\270/\355\224\204\353\241\234\352\267\270\353\236\230\353\250\270\354\212\244/7\354\243\274\354\260\250/\353\247\210\353\262\225\354\235\230\354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.py" "b/\354\235\264\354\236\254\354\235\270/\355\224\204\353\241\234\352\267\270\353\236\230\353\250\270\354\212\244/7\354\243\274\354\260\250/\353\247\210\353\262\225\354\235\230\354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.py" new file mode 100644 index 0000000..356fb98 --- /dev/null +++ "b/\354\235\264\354\236\254\354\235\270/\355\224\204\353\241\234\352\267\270\353\236\230\353\250\270\354\212\244/7\354\243\274\354\260\250/\353\247\210\353\262\225\354\235\230\354\227\230\353\246\254\353\262\240\354\235\264\355\204\260.py" @@ -0,0 +1,14 @@ +def solution(storey): + result = 0 + while storey > 0: + num = storey % 10 + next_num = (storey // 10) % 10 + + + if num > 5 or (num == 5 and next_num >= 5): + result += 10 - num + storey = (storey // 10) + 1 + else: + result += num + storey //= 10 + return result \ No newline at end of file