結果
| 問題 | No.99 ジャンピング駒 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-14 18:20:22 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 356 bytes |
| 記録 | |
| コンパイル時間 | 13,471 ms |
| コンパイル使用メモリ | 403,468 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-20 10:02:02 |
| 合計ジャッジ時間 | 14,860 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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());
}