結果

問題 No.499 7進数変換
ユーザー n3k2t1
提出日時 2019-07-22 01:48:21
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 237 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-23 07:25:30
合計ジャッジ時間 2,051 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())

if N==0:
    print(0)
    exit

#
ans = ''
m = int(math.log(N, 7) + 1)

for i in range(m, -1, -1):
    ans += str(N // (7**i))
    N %= 7**i

if ans.startswith('0'):
    print(ans[1:])
else:
    print(ans)
0