結果

問題 No.2385 Parse Integer with Radix
ユーザー prince-aegonprince-aegon
提出日時 2023-07-28 15:49:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2024-04-16 00:10:42
合計ジャッジ時間 1,601 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
52,352 KB
testcase_01 AC 45 ms
52,392 KB
testcase_02 AC 45 ms
52,736 KB
testcase_03 AC 45 ms
52,608 KB
testcase_04 AC 45 ms
52,420 KB
testcase_05 AC 46 ms
52,608 KB
testcase_06 AC 45 ms
52,096 KB
testcase_07 AC 48 ms
52,352 KB
testcase_08 AC 51 ms
52,096 KB
testcase_09 AC 45 ms
52,736 KB
testcase_10 AC 45 ms
52,736 KB
testcase_11 AC 46 ms
52,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

tests = int(input())
for test in range(tests):
    s = input()
    if s[:2] == '0b':
        print(int(s[2:], 2))
    elif s[:2] == '0o':
        print(int(s[2:], 8))
    elif s[:2] == '0x':
        print(int(s[2:], 16))
    else:
        print(s)
0