結果

問題 No.2385 Parse Integer with Radix
ユーザー 遭難者遭難者
提出日時 2023-07-21 21:27:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 53,420 KB
最終ジャッジ日時 2023-10-21 21:16:59
合計ジャッジ時間 1,348 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,420 KB
testcase_01 AC 33 ms
53,420 KB
testcase_02 AC 34 ms
53,420 KB
testcase_03 AC 35 ms
53,420 KB
testcase_04 AC 34 ms
53,420 KB
testcase_05 AC 34 ms
53,420 KB
testcase_06 AC 33 ms
53,420 KB
testcase_07 AC 34 ms
53,420 KB
testcase_08 AC 34 ms
53,420 KB
testcase_09 AC 34 ms
53,420 KB
testcase_10 AC 34 ms
53,420 KB
testcase_11 AC 34 ms
53,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# input = sys.stdin.readline


def main() -> None:
    s = input()
    if len(s) == 1:
        print(s)
        return
    sen, got = s[:2], s[2:]
    if sen == "0b":
        return print(int(got, 2))
    if sen == "0o":
        return print(int(got, 8))
    if sen == "0x":
        return print(int(got, 16))
    print(s)


# if __name__ == "__main__":
for i in range(int(input())):
    main()
0