結果

問題 No.782 マイナス進数
ユーザー 👑 KazunKazun
提出日時 2020-10-22 00:49:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 1,664 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 78,280 KB
最終ジャッジ日時 2023-09-28 14:31:15
合計ジャッジ時間 6,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,172 KB
testcase_01 AC 72 ms
71,408 KB
testcase_02 AC 110 ms
77,404 KB
testcase_03 AC 104 ms
77,412 KB
testcase_04 AC 102 ms
77,640 KB
testcase_05 AC 102 ms
77,420 KB
testcase_06 AC 103 ms
77,540 KB
testcase_07 AC 106 ms
78,280 KB
testcase_08 AC 103 ms
77,476 KB
testcase_09 AC 106 ms
77,548 KB
testcase_10 AC 104 ms
77,476 KB
testcase_11 AC 109 ms
77,992 KB
testcase_12 AC 104 ms
78,144 KB
testcase_13 AC 116 ms
78,276 KB
testcase_14 AC 106 ms
78,152 KB
testcase_15 AC 109 ms
77,936 KB
testcase_16 AC 107 ms
78,176 KB
testcase_17 AC 112 ms
77,732 KB
testcase_18 AC 107 ms
78,152 KB
testcase_19 AC 109 ms
77,788 KB
testcase_20 AC 106 ms
78,140 KB
testcase_21 AC 112 ms
77,772 KB
testcase_22 AC 110 ms
78,280 KB
testcase_23 AC 106 ms
77,432 KB
testcase_24 AC 118 ms
77,888 KB
testcase_25 AC 105 ms
78,152 KB
testcase_26 AC 108 ms
77,768 KB
testcase_27 AC 108 ms
78,232 KB
testcase_28 AC 107 ms
78,272 KB
testcase_29 AC 73 ms
71,348 KB
testcase_30 AC 74 ms
71,332 KB
testcase_31 AC 76 ms
71,144 KB
testcase_32 AC 80 ms
76,012 KB
testcase_33 AC 72 ms
71,416 KB
testcase_34 AC 74 ms
71,140 KB
testcase_35 AC 75 ms
71,220 KB
testcase_36 AC 75 ms
71,132 KB
testcase_37 AC 74 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

X=[""]*T

for i in range(T):
    N=int(input())
    if N==0:
        X[i]="0"
        continue

    A=""
    while N:
        a=N%(-B)
        N=(N-a)//B
        A+=str(a)

    X[i]=A[::-1]

print(*X,sep="\n")
0