結果

問題 No.782 マイナス進数
ユーザー maspy
提出日時 2020-02-03 21:43:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-09-19 06:47:31
合計ジャッジ時間 5,240 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

T,B,*nums = map(int,read().split())

for n in nums:
    rep = []
    while n:
        r = n % (-B)
        n = (n - r) // B
        rep.append(r)
    print(''.join(map(str,reversed(rep))))
0