結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2023-01-27 18:47:41 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 13,360 ms |
コンパイル使用メモリ | 397,396 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 03:59:19 |
合計ジャッジ時間 | 14,597 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let a: Vec<char> = itr.next().unwrap().chars().collect(); let b: Vec<char> = itr.next().unwrap().chars().collect(); if a.len() > b.len() { println!("{}", a.iter().collect::<String>()); } else if a.len() < b.len() { println!("{}", b.iter().collect::<String>()); } else { for i in 0..a.len() { match (a[i], b[i]) { ('4', '7') => println!("{}", a.iter().collect::<String>()), ('7', '4') => println!("{}", b.iter().collect::<String>()), (_, _) if a[i] > b[i] => println!("{}", a.iter().collect::<String>()), (_, _) if a[i] < b[i] => println!("{}", b.iter().collect::<String>()), _ => continue, } return; } } }