結果
| 問題 |
No.2385 Parse Integer with Radix
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-21 21:24:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 2,000 ms |
| コード長 | 570 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,588 KB |
| 実行使用メモリ | 85,760 KB |
| 最終ジャッジ日時 | 2024-09-21 22:38:05 |
| 合計ジャッジ時間 | 2,486 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
q = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
# alist.append(list(map(int,input().split())))
for i in range(q):
s = input()
if len(s) <= 1:
print(int(s))
elif s[1] == 'b':
print(int(s,base=2))
elif s[1] == 'o':
print(int(s,base=8))
elif s[1] == 'x':
print(int(s,base=16))
else:
print(int(s))