結果
| 問題 |
No.2385 Parse Integer with Radix
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-21 21:41:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 537 bytes |
| コンパイル時間 | 1,498 ms |
| コンパイル使用メモリ | 167,244 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-21 23:05:48 |
| 合計ジャッジ時間 | 2,599 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int q;
cin >> q;
while(q--){
string s;
cin >> s;
if(s=="0"){
cout << 0 << endl;
} else if(s[1]=='b'){
cout << stoll(s.substr(2),nullptr,2) << endl;
} else if(s[1]=='o'){
cout << stoll(s.substr(2),nullptr,8) << endl;
} else if(s[1]=='x'){
cout << stoll(s.substr(2),nullptr,16) << endl;
} else {
cout << s << endl;
}
}
return 0;
}