結果

問題 No.2385 Parse Integer with Radix
ユーザー Konton7Konton7
提出日時 2023-07-21 22:01:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 436 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,892 KB
実行使用メモリ 42,200 KB
最終ジャッジ日時 2023-10-21 22:02:34
合計ジャッジ時間 8,059 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 420 ms
42,200 KB
testcase_01 AC 436 ms
42,200 KB
testcase_02 AC 435 ms
42,200 KB
testcase_03 AC 409 ms
42,200 KB
testcase_04 AC 411 ms
42,200 KB
testcase_05 AC 426 ms
42,200 KB
testcase_06 AC 425 ms
42,200 KB
testcase_07 AC 421 ms
42,200 KB
testcase_08 AC 418 ms
42,200 KB
testcase_09 AC 416 ms
42,200 KB
testcase_10 AC 406 ms
42,200 KB
testcase_11 AC 403 ms
42,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math 
import numpy as np
import sys
import os

# f = open('out.txt')
# sys.stdin = f

q = int(input())
for _ in range(q):
    n = input()
    if n[:2] == "0b":
        print(int(n[2:], 2))
    elif n[:2] == "0o":
        print(int(n[2:], 8))
    elif n[:2] == "0x":
        print(int(n[2:], 16))
    else:
        print(n)
0