結果

問題 No.782 マイナス進数
ユーザー yuppe19 😺yuppe19 😺
提出日時 2019-01-11 21:26:48
言語 Python2
(2.7.18)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 6,172 KB
最終ジャッジ日時 2023-08-20 03:29:47
合計ジャッジ時間 4,004 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,156 KB
testcase_01 AC 12 ms
6,156 KB
testcase_02 AC 42 ms
6,100 KB
testcase_03 AC 45 ms
6,160 KB
testcase_04 AC 49 ms
6,056 KB
testcase_05 AC 43 ms
5,956 KB
testcase_06 AC 42 ms
5,964 KB
testcase_07 AC 58 ms
5,988 KB
testcase_08 AC 45 ms
6,140 KB
testcase_09 AC 42 ms
5,960 KB
testcase_10 AC 43 ms
6,152 KB
testcase_11 AC 56 ms
6,028 KB
testcase_12 AC 53 ms
6,100 KB
testcase_13 AC 87 ms
5,960 KB
testcase_14 AC 53 ms
6,144 KB
testcase_15 AC 56 ms
5,960 KB
testcase_16 AC 52 ms
6,032 KB
testcase_17 AC 70 ms
5,964 KB
testcase_18 AC 53 ms
6,052 KB
testcase_19 AC 63 ms
6,100 KB
testcase_20 AC 52 ms
6,152 KB
testcase_21 AC 67 ms
6,172 KB
testcase_22 AC 55 ms
6,096 KB
testcase_23 AC 51 ms
5,960 KB
testcase_24 AC 86 ms
6,032 KB
testcase_25 AC 52 ms
6,036 KB
testcase_26 AC 60 ms
6,100 KB
testcase_27 AC 56 ms
6,100 KB
testcase_28 AC 53 ms
6,100 KB
testcase_29 AC 12 ms
5,960 KB
testcase_30 AC 12 ms
6,036 KB
testcase_31 AC 12 ms
5,960 KB
testcase_32 AC 13 ms
5,988 KB
testcase_33 AC 12 ms
6,032 KB
testcase_34 AC 13 ms
5,984 KB
testcase_35 AC 12 ms
6,004 KB
testcase_36 AC 12 ms
5,964 KB
testcase_37 AC 11 ms
5,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
import string

def int2negbase(num, base, digits=string.digits+string.ascii_uppercase):
    assert base < -1
    num = -num
    if num == 0:
        return digits[0]
    s = ''
    while num != 0:
        s = digits[-(num % base)] + s
        num /= base
    return s

T, B = map(int, raw_input().split())
for loop in xrange(T):
    N = int(raw_input())
    res = int2negbase(N, B)
    print res
0