結果
| 問題 |
No.2385 Parse Integer with Radix
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-22 15:08:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 282 bytes |
| コンパイル時間 | 1,598 ms |
| コンパイル使用メモリ | 175,832 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 14:52:57 |
| 合計ジャッジ時間 | 2,154 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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 << (s.size() < 2 || isdigit(s[1]) ? stoll(s) : stoll(s.substr(2), 0, mp[s[1]])) << '\n';
}
}