結果

問題 No.782 マイナス進数
ユーザー hedwig100hedwig100
提出日時 2020-04-26 10:34:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-04-27 20:07:17
合計ジャッジ時間 5,152 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 71 ms
11,136 KB
testcase_03 AC 76 ms
11,136 KB
testcase_04 AC 82 ms
11,136 KB
testcase_05 AC 73 ms
11,264 KB
testcase_06 AC 71 ms
11,264 KB
testcase_07 AC 102 ms
11,136 KB
testcase_08 AC 75 ms
11,008 KB
testcase_09 AC 70 ms
11,264 KB
testcase_10 AC 70 ms
11,008 KB
testcase_11 AC 95 ms
11,008 KB
testcase_12 AC 90 ms
11,264 KB
testcase_13 AC 151 ms
11,008 KB
testcase_14 AC 90 ms
11,008 KB
testcase_15 AC 96 ms
11,008 KB
testcase_16 AC 92 ms
11,008 KB
testcase_17 AC 121 ms
11,136 KB
testcase_18 AC 90 ms
11,136 KB
testcase_19 AC 109 ms
11,008 KB
testcase_20 AC 90 ms
11,008 KB
testcase_21 AC 115 ms
11,008 KB
testcase_22 AC 94 ms
11,136 KB
testcase_23 AC 83 ms
11,008 KB
testcase_24 AC 149 ms
11,008 KB
testcase_25 AC 88 ms
11,008 KB
testcase_26 AC 101 ms
11,264 KB
testcase_27 AC 97 ms
11,008 KB
testcase_28 AC 87 ms
11,136 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 #

INF = 10 ** 9
MOD = 10 **9 + 7
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)

def main():
    t,b = map(int,input().split())
    b *= -1
    N = [int(input()) for _ in range(t)]

    for n in N:
        ans = ''
        while n:
            ans += str(n%b)
            n //= b
            n *= -1
        print(ans[::-1])
if __name__=='__main__':
    main()
0