結果

問題 No.2385 Parse Integer with Radix
ユーザー komkompikomkompi
提出日時 2023-07-21 21:38:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 529 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 43,936 KB
最終ジャッジ日時 2024-09-21 23:02:14
合計ジャッジ時間 8,905 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import numpy as np

Q=int(input())


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