結果

問題 No.99 ジャンピング駒
ユーザー r6ever6eve
提出日時 2017-08-15 19:29:41
言語 OCaml
(5.1.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 262 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 21,452 KB
実行使用メモリ 6,656 KB
最終ジャッジ日時 2024-04-17 08:41:11
合計ジャッジ時間 1,040 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
6,656 KB
testcase_01 AC 30 ms
6,528 KB
testcase_02 AC 29 ms
6,528 KB
testcase_03 AC 30 ms
6,656 KB
testcase_04 AC 30 ms
6,656 KB
testcase_05 AC 29 ms
6,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let read () = Scanf.scanf "%d " (fun i -> i)

let () =
  let n = read () in
  Array.init n (fun _ -> read ())
  |> Array.fold_left (fun (e, o) x ->
    if x mod 2 = 0 then (e + 1, o) else (e, o + 1)) (0, 0)
  |> (fun (e, o) -> Printf.printf "%d\n" (abs (e - o)))
0