結果

問題 No.782 マイナス進数
ユーザー koba-e964koba-e964
提出日時 2021-12-11 15:04:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 77,652 KB
最終ジャッジ日時 2023-09-27 02:37:54
合計ジャッジ時間 5,197 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,332 KB
testcase_01 AC 71 ms
71,576 KB
testcase_02 AC 92 ms
77,652 KB
testcase_03 AC 93 ms
77,568 KB
testcase_04 AC 92 ms
77,556 KB
testcase_05 AC 88 ms
77,556 KB
testcase_06 AC 88 ms
77,544 KB
testcase_07 AC 91 ms
77,412 KB
testcase_08 AC 91 ms
77,560 KB
testcase_09 AC 92 ms
77,648 KB
testcase_10 AC 87 ms
77,472 KB
testcase_11 AC 91 ms
77,324 KB
testcase_12 AC 90 ms
77,360 KB
testcase_13 AC 99 ms
77,340 KB
testcase_14 AC 91 ms
77,484 KB
testcase_15 AC 93 ms
77,520 KB
testcase_16 AC 92 ms
77,420 KB
testcase_17 AC 96 ms
77,004 KB
testcase_18 AC 93 ms
77,528 KB
testcase_19 AC 94 ms
77,520 KB
testcase_20 AC 92 ms
77,504 KB
testcase_21 AC 94 ms
77,368 KB
testcase_22 AC 90 ms
77,376 KB
testcase_23 AC 90 ms
77,488 KB
testcase_24 AC 99 ms
77,336 KB
testcase_25 AC 90 ms
77,484 KB
testcase_26 AC 90 ms
77,368 KB
testcase_27 AC 91 ms
77,372 KB
testcase_28 AC 90 ms
77,424 KB
testcase_29 AC 71 ms
71,196 KB
testcase_30 AC 70 ms
71,340 KB
testcase_31 AC 72 ms
71,364 KB
testcase_32 AC 81 ms
77,008 KB
testcase_33 AC 72 ms
71,328 KB
testcase_34 AC 72 ms
71,436 KB
testcase_35 AC 72 ms
71,572 KB
testcase_36 AC 74 ms
71,508 KB
testcase_37 AC 74 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

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
    if s == '':
        s = '0'
    print(''.join(reversed(s)))
0