結果
問題 |
No.2385 Parse Integer with Radix
|
ユーザー |
|
提出日時 | 2023-07-22 15:19:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 269 bytes |
コンパイル時間 | 5,626 ms |
コンパイル使用メモリ | 286,868 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 15:03:23 |
合計ジャッジ時間 | 6,178 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 << (regex_match(s, regex("[0-9]*")) ? stoll(s) : stoll(s.substr(2), 0, mp[s[1]])) << '\n'; }