結果

問題 No.99 ジャンピング駒
コンテスト
ユーザー tak
提出日時 2018-08-07 18:16:21
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
WA  
実行時間 -
コード長 451 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,719 ms
コンパイル使用メモリ 217,140 KB
実行使用メモリ 46,116 KB
最終ジャッジ日時 2026-08-31 06:35:05
合計ジャッジ時間 6,605 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (164 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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