結果

問題 No.499 7進数変換
ユーザー yoshi_k
提出日時 2017-09-17 04:07:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 245 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-08 01:45:24
合計ジャッジ時間 2,031 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

i = 0
while True:
    if 7**i > n:
        break
    i += 1

i -= 1
if i < 0:
    i = 0

ans = ""
tmp = n
while True:
    m = 7**i
    ans += str(tmp // m)
    tmp = tmp % m
    i -= 1
    if i == -1:
        break

print(ans)
0