結果
問題 | No.432 占い(Easy) |
ユーザー |
![]() |
提出日時 | 2022-12-27 23:43:31 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 530 bytes |
コンパイル時間 | 13,034 ms |
コンパイル使用メモリ | 379,576 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 11:09:28 |
合計ジャッジ時間 | 14,246 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
fn main() {let mut xx = String::new();std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok();let xx: Vec<&str> = xx.split_whitespace().skip(1).collect();let table: Vec<usize> = (0..=9).chain(1..=9).collect();let conv = |c: char| c.to_digit(10).unwrap() as usize;for &x in &xx {let mut x: Vec<usize> = x.chars().map(conv).collect();while x.len() > 1 {x = x.windows(2).map(|x| table[x[0] + x[1]]).collect();}println!("{}", x[0]);}}