結果
問題 |
No.2385 Parse Integer with Radix
|
ユーザー |
![]() |
提出日時 | 2023-07-21 21:24:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 178 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-09-21 22:37:36 |
合計ジャッジ時間 | 1,187 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 11 |
ソースコード
import sys input = sys.stdin.readline Q = int(input()) for _ in range(Q): N = input() if len(N) <= 2: print(N) continue if 0 <= ord(N[1]) - ord("0") <= 9: print(N) continue if N[1] == "b": print(int(N[2:], 2)) elif N[1] == "o": print(int(N[2:], 8)) else: print(int(N[2:], 16))