結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,420 KB
testcase_01 AC 72 ms
71,100 KB
testcase_02 AC 94 ms
77,640 KB
testcase_03 AC 90 ms
77,536 KB
testcase_04 AC 91 ms
77,588 KB
testcase_05 AC 90 ms
77,416 KB
testcase_06 AC 91 ms
77,556 KB
testcase_07 AC 92 ms
77,624 KB
testcase_08 AC 91 ms
77,672 KB
testcase_09 AC 92 ms
77,468 KB
testcase_10 AC 90 ms
77,760 KB
testcase_11 AC 94 ms
77,548 KB
testcase_12 AC 90 ms
77,548 KB
testcase_13 AC 98 ms
77,680 KB
testcase_14 AC 91 ms
77,556 KB
testcase_15 AC 93 ms
77,528 KB
testcase_16 AC 93 ms
77,656 KB
testcase_17 AC 95 ms
77,452 KB
testcase_18 AC 92 ms
77,224 KB
testcase_19 AC 92 ms
77,608 KB
testcase_20 AC 92 ms
77,544 KB
testcase_21 AC 93 ms
77,616 KB
testcase_22 AC 90 ms
77,560 KB
testcase_23 AC 90 ms
77,512 KB
testcase_24 AC 97 ms
77,236 KB
testcase_25 AC 89 ms
77,456 KB
testcase_26 AC 90 ms
77,600 KB
testcase_27 AC 91 ms
77,496 KB
testcase_28 AC 91 ms
77,616 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