結果

問題 No.99 ジャンピング駒
コンテスト
ユーザー ⁣
提出日時 2024-05-14 18:20:22
言語 Rust
(1.99.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
RE  
実行時間 -
コード長 356 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 789 ms
コンパイル使用メモリ 201,004 KB
実行使用メモリ 7,856 KB
最終ジャッジ日時 2026-10-05 03:43:32
合計ジャッジ時間 2,872 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::{collections::HashMap, io::Read};

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let n: Vec<i32> =
		s.split_whitespace().skip(1).flat_map(str::parse).collect();
	let mut h = HashMap::new();
	n.iter()
		.for_each(|&x| *h.entry(x.abs() % 2).or_insert(0i32) += 1);
	println!("{}", (h[&0] - h[&1]).abs());
}
0