結果

問題 No.499 7進数変換
ユーザー mokraimokrai
提出日時 2017-11-12 22:32:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-08-16 11:02:31
合計ジャッジ時間 1,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,808 KB
testcase_01 AC 16 ms
7,920 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 16 ms
7,824 KB
testcase_04 AC 16 ms
7,820 KB
testcase_05 AC 16 ms
7,816 KB
testcase_06 AC 16 ms
7,732 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,900 KB
testcase_09 AC 16 ms
7,760 KB
testcase_10 AC 15 ms
7,800 KB
testcase_11 AC 16 ms
7,824 KB
testcase_12 AC 16 ms
7,808 KB
testcase_13 AC 16 ms
7,780 KB
testcase_14 AC 15 ms
7,812 KB
testcase_15 AC 16 ms
7,844 KB
testcase_16 AC 16 ms
7,808 KB
testcase_17 AC 16 ms
7,764 KB
testcase_18 WA -
testcase_19 AC 16 ms
7,912 KB
testcase_20 AC 16 ms
7,780 KB
testcase_21 AC 16 ms
7,824 KB
testcase_22 AC 15 ms
7,824 KB
testcase_23 AC 16 ms
7,860 KB
testcase_24 AC 16 ms
7,812 KB
testcase_25 AC 17 ms
7,764 KB
testcase_26 AC 16 ms
7,808 KB
testcase_27 AC 16 ms
7,824 KB
testcase_28 AC 16 ms
7,780 KB
testcase_29 AC 16 ms
7,824 KB
testcase_30 AC 16 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    foo_list = []

    value = 0
    while 7 ** value < N:
        value += 1

    num_of_digit = value - 1 

    for i in range(num_of_digit):
        digit = num_of_digit - i
        value2 = 0
        while (7 ** digit) * value2 <= N:
            value2 += 1
        foo_list.append(value2 - 1)
        N = N - (7 ** digit) * (value2 - 1)
    foo_list.append(N)

    for i in foo_list:
        print(i, end='')
    print()


if __name__ == '__main__':
    main()
0