結果

問題 No.782 マイナス進数
ユーザー koba-e964koba-e964
提出日時 2021-12-11 15:02:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 77,636 KB
最終ジャッジ日時 2023-09-27 02:36:08
合計ジャッジ時間 5,790 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,400 KB
testcase_01 AC 76 ms
71,444 KB
testcase_02 AC 123 ms
77,468 KB
testcase_03 AC 89 ms
77,384 KB
testcase_04 AC 92 ms
77,572 KB
testcase_05 AC 90 ms
77,388 KB
testcase_06 AC 90 ms
77,584 KB
testcase_07 AC 89 ms
77,464 KB
testcase_08 AC 89 ms
77,536 KB
testcase_09 AC 90 ms
77,636 KB
testcase_10 AC 88 ms
77,532 KB
testcase_11 AC 91 ms
77,328 KB
testcase_12 AC 89 ms
77,524 KB
testcase_13 AC 98 ms
77,452 KB
testcase_14 AC 90 ms
77,500 KB
testcase_15 AC 92 ms
77,380 KB
testcase_16 AC 91 ms
77,316 KB
testcase_17 AC 94 ms
77,356 KB
testcase_18 AC 89 ms
77,232 KB
testcase_19 AC 90 ms
77,424 KB
testcase_20 AC 90 ms
77,252 KB
testcase_21 AC 92 ms
77,428 KB
testcase_22 AC 92 ms
77,456 KB
testcase_23 AC 90 ms
77,508 KB
testcase_24 AC 98 ms
77,576 KB
testcase_25 AC 89 ms
77,524 KB
testcase_26 AC 90 ms
77,276 KB
testcase_27 AC 91 ms
77,328 KB
testcase_28 AC 91 ms
77,492 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 #

#!/usr/bin/env python3

import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

t, b = map(int, readline().split())
for _ in range(t):
    n = int(readline())
    s = ''
    while n != 0:
        r = n % (-b)
        s += chr(48 + r)
        n = (n - r) // b
    print(''.join(reversed(s)))
0