結果

問題 No.99 ジャンピング駒
ユーザー iwotiwot
提出日時 2020-06-21 13:51:00
言語 F#
(F# 4.0)
結果
AC  
実行時間 149 ms / 5,000 ms
コード長 256 bytes
コンパイル時間 3,996 ms
コンパイル使用メモリ 156,956 KB
実行使用メモリ 39,764 KB
最終ジャッジ日時 2023-09-16 18:18:16
合計ジャッジ時間 4,719 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
39,564 KB
testcase_01 AC 145 ms
39,668 KB
testcase_02 AC 146 ms
37,504 KB
testcase_03 AC 146 ms
37,656 KB
testcase_04 AC 149 ms
37,556 KB
testcase_05 AC 149 ms
39,764 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let N = stdin.ReadLine().Trim() |> int64
let XS = stdin.ReadLine().Split(' ') |> Array.map int64

let odds = Array.fold (fun acc n -> if n % 2L <> 0L then acc + 1L else acc) 0L XS
let evens = (XS.Length |> int64) - odds

printfn "%d" <| abs (odds - evens)
0