結果

問題 No.782 マイナス進数
ユーザー H3PO4H3PO4
提出日時 2021-02-03 12:56:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-09-12 11:54:55
合計ジャッジ時間 6,069 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,896 KB
testcase_02 AC 88 ms
7,864 KB
testcase_03 AC 93 ms
7,952 KB
testcase_04 AC 104 ms
7,872 KB
testcase_05 AC 89 ms
7,872 KB
testcase_06 AC 88 ms
7,784 KB
testcase_07 AC 116 ms
7,788 KB
testcase_08 AC 93 ms
7,916 KB
testcase_09 AC 88 ms
7,912 KB
testcase_10 AC 88 ms
7,820 KB
testcase_11 AC 114 ms
7,852 KB
testcase_12 AC 107 ms
7,892 KB
testcase_13 AC 170 ms
7,860 KB
testcase_14 AC 109 ms
7,860 KB
testcase_15 AC 115 ms
7,856 KB
testcase_16 AC 109 ms
7,960 KB
testcase_17 AC 139 ms
7,852 KB
testcase_18 AC 109 ms
7,896 KB
testcase_19 AC 127 ms
7,812 KB
testcase_20 AC 110 ms
7,952 KB
testcase_21 AC 133 ms
7,916 KB
testcase_22 AC 113 ms
7,788 KB
testcase_23 AC 103 ms
7,784 KB
testcase_24 AC 168 ms
7,852 KB
testcase_25 AC 110 ms
7,840 KB
testcase_26 AC 121 ms
7,892 KB
testcase_27 AC 114 ms
7,812 KB
testcase_28 AC 107 ms
7,856 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T, B = map(int, input().split())


def solve(N):
    lst = []
    while N:
        N, m = divmod(N, B)
        if m < 0:
            m -= B
            N += 1
        lst.append(m)
    res = ''.join(map(str, reversed(lst)))
    return res


for _ in range(T):
    print(solve(int(input())))
0