結果

問題 No.99 ジャンピング駒
ユーザー taktak
提出日時 2018-08-07 18:16:21
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 6,858 ms
コンパイル使用メモリ 190,872 KB
実行使用メモリ 47,324 KB
最終ジャッジ日時 2023-10-19 22:28:56
合計ジャッジ時間 8,307 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 105 ms
47,320 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (232 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

let f xs = 
    let size = Array.length
    let isOdd x = x % 2 <> 0
    let odds = xs |> Array.where(isOdd)
    let eves = xs |> Array.where(isOdd >> fun x -> not x)
    let oddsN = odds |> size
    let evesN = eves |> size
    match (isOdd oddsN), (isOdd evesN) with
    | true, true -> 0
    | true, _ -> 1
    | _, true -> 1
    | _ -> 2

let R() = stdin.ReadLine()

let N = R() |> int
let X = R().Split() |> Array.map int

f X |> stdout.WriteLine
0