Submission #37614302


Source Code Expand

n8, k = map(int, input().split())

if n8 == 0:
  print(0)
  exit()

for i in range(k):
  n10 = 0
  i = 0
  while n8 > 0:
    n10 += n8 % 10 * 8 ** i
    n8 //= 10
    i += 1
  
  n9 = []
  while n10 > 0:
    n9.append(n10 % 9)
    n10 //= 9
  
  n9 = "".join(map(str, n9[::-1])).replace("8", "5")
  n8 = int(n9)

print(n8)
    

Submission Info

Submission Time
Task 067 - Base 8 to 9(★2)
User moshida
Language Python (3.8.2)
Score 2
Code Size 354 Byte
Status AC
Exec Time 23 ms
Memory 9168 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 2 / 2
Status
AC × 3
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt AC 21 ms 9116 KiB
hand_02.txt AC 21 ms 9144 KiB
hand_03.txt AC 19 ms 9104 KiB
hand_04.txt AC 16 ms 8880 KiB
hand_05.txt AC 19 ms 9108 KiB
random_01.txt AC 17 ms 9020 KiB
random_02.txt AC 16 ms 9168 KiB
random_03.txt AC 16 ms 9028 KiB
random_04.txt AC 16 ms 8992 KiB
random_05.txt AC 21 ms 9164 KiB
random_06.txt AC 18 ms 9036 KiB
random_07.txt AC 21 ms 8992 KiB
random_08.txt AC 18 ms 9028 KiB
random_09.txt AC 18 ms 9020 KiB
random_10.txt AC 16 ms 9108 KiB
random_11.txt AC 18 ms 9020 KiB
random_12.txt AC 19 ms 8888 KiB
random_13.txt AC 17 ms 9112 KiB
random_14.txt AC 22 ms 9036 KiB
random_15.txt AC 21 ms 9036 KiB
random_16.txt AC 16 ms 8896 KiB
random_17.txt AC 23 ms 8896 KiB
random_18.txt AC 17 ms 8892 KiB
random_19.txt AC 18 ms 8896 KiB
random_20.txt AC 17 ms 9140 KiB
sample_01.txt AC 19 ms 8888 KiB
sample_02.txt AC 19 ms 8896 KiB
sample_03.txt AC 19 ms 9148 KiB