結果

問題 No.201 yukicoderじゃんけん
コンテスト
ユーザー ⁣
提出日時 2024-05-16 15:48:52
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 821µs
コード長 643 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 441 ms
コンパイル使用メモリ 188,208 KB
実行使用メモリ 9,836 KB
最終ジャッジ日時 2026-10-05 04:00:23
合計ジャッジ時間 2,235 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::Read;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let v: Vec<_> = s.split_whitespace().collect();
	match v {
		v if v[1] == v[4] => println!("-1"),
		v if v[1].len() > v[4].len() => println!("{}", v[0]),
		v if v[1].len() < v[4].len() => println!("{}", v[3]),
		_ => {
			for c in v[1]
				.chars()
				.flat_map(|c| c.to_digit(10))
				.zip(v[4].chars().flat_map(|c| c.to_digit(10)))
			{
				match c {
					(a, b) if a > b => {
						println!("{}", v[0]);
						break;
					}
					(a, b) if a < b => {
						println!("{}", v[3]);
						break;
					}
					_ => {}
				}
			}
		}
	}
}
0