結果

問題 No.2385 Parse Integer with Radix
ユーザー とろちゃとろちゃ
提出日時 2023-07-21 21:24:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 822 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 53,432 KB
最終ジャッジ日時 2023-10-21 21:12:25
合計ジャッジ時間 1,318 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys

# sys.setrecursionlimit(10**6) # PyPyだと遅い
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
File = sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


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