結果
| 問題 | No.99 ジャンピング駒 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-14 18:20:22 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 356 bytes |
| 記録 | |
| コンパイル時間 | 2,088 ms |
| コンパイル使用メモリ | 194,000 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-27 11:27:31 |
| 合計ジャッジ時間 | 3,007 ms |
|
ジャッジサーバーID (参考情報) |
<nil> / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 RE * 2 |
ソースコード
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());
}