結果

問題 No.2239 Friday
コンテスト
ユーザー
提出日時 2024-07-15 12:26:04
言語 Rust
(1.93.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 332 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 810 ms
コンパイル使用メモリ 187,520 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-30 15:57:03
合計ジャッジ時間 2,139 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

fn main() {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	let n: Vec<u8> = s.split_whitespace().flat_map(str::parse).collect();
	let s = n[0] + n[1];
	let t = n[0].min(n[1]) * 2;
	println!(
		"{}",
		match s - t {
			f if t <= f => f - t,
			_ if s % 2 > 0 => 1,
			_ if s % 4 > 0 => 2,
			_ => 0,
		}
	)
}
0