結果

問題 No.293 4>7の世界
コンテスト
ユーザー ixTL255
提出日時 2023-01-27 18:47:41
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 2,000 ms
+ 916µs
コード長 773 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 739 ms
コンパイル使用メモリ 183,624 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-31 15:49:02
合計ジャッジ時間 2,538 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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;
		}
	}
}
0