結果

問題 No.1109 調の判定
ユーザー maimai8maimai8
提出日時 2020-09-09 12:28:05
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 21,708 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 09:11:08
合計ジャッジ時間 1,359 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 WA -
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 1 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let () =
  Scanf.scanf "%d\n" @@ fun n ->
  let t = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d in
  let check d x =
    if List.mem ((x-d+12) mod 12) [0;2;4;5;7;9;11] then true else false in
  let num = ref [] in
  let i = ref 0 in
  while !i < n do
    let d = t.(!i) in
    let b = Array.fold_left (fun b x -> b && (check d x)) true t in
    if b then num := d :: !num;
    i := !i + 1
  done;
  Printf.printf "%d\n" (if List.length !num = 1 then List.hd !num else -1)
0