結果
問題 | No.2385 Parse Integer with Radix |
ユーザー |
|
提出日時 | 2024-07-18 16:53:23 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 391 bytes |
コンパイル時間 | 10,425 ms |
コンパイル使用メモリ | 384,048 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 16:53:38 |
合計ジャッジ時間 | 11,126 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
use std::io::Read;fn r(s: &str) -> u32 {if s.len() < 3 {return 0;}match &s[1..2] {"b" => 2,"o" => 8,"x" => 16,_ => 0,}}fn main() {let mut s = String::new();std::io::stdin().read_to_string(&mut s).ok();for s in s.lines().skip(1) {println!("{:?}",match r(s) {0 => s.parse(),r => u64::from_str_radix(&s[2..], r),}.unwrap())}}