結果
| 問題 |
No.2385 Parse Integer with Radix
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-22 15:23:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 256 bytes |
| コンパイル時間 | 1,777 ms |
| コンパイル使用メモリ | 175,832 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 15:07:42 |
| 合計ジャッジ時間 | 2,311 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int T;
string s;
map<char, int> mp{{'b', 2}, {'o', 8}, {'x', 16}};
cin >> T;
while(cin >> s)cout << (isdigit((s+'0')[1]) ? stoll(s) : stoll(s.substr(2), 0, mp[s[1]])) << '\n';
}