結果

問題 No.1109 調の判定
ユーザー ikdikd
提出日時 2020-07-10 23:02:58
言語 F#
(F# 4.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 10,492 ms
コンパイル使用メモリ 193,140 KB
実行使用メモリ 35,080 KB
最終ジャッジ日時 2024-04-19 22:52:29
合計ジャッジ時間 18,434 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
34,428 KB
testcase_01 AC 65 ms
30,336 KB
testcase_02 AC 68 ms
30,448 KB
testcase_03 AC 318 ms
34,564 KB
testcase_04 AC 311 ms
35,080 KB
testcase_05 AC 311 ms
33,928 KB
testcase_06 AC 68 ms
30,336 KB
testcase_07 AC 67 ms
30,440 KB
testcase_08 AC 324 ms
34,700 KB
testcase_09 AC 320 ms
34,696 KB
testcase_10 AC 321 ms
34,952 KB
testcase_11 AC 69 ms
30,336 KB
testcase_12 AC 67 ms
30,336 KB
testcase_13 AC 67 ms
30,464 KB
testcase_14 AC 69 ms
30,336 KB
testcase_15 AC 67 ms
30,336 KB
testcase_16 AC 69 ms
30,576 KB
testcase_17 AC 65 ms
30,336 KB
testcase_18 AC 70 ms
30,332 KB
testcase_19 AC 70 ms
30,464 KB
testcase_20 AC 70 ms
30,464 KB
testcase_21 AC 69 ms
30,336 KB
testcase_22 AC 70 ms
30,592 KB
testcase_23 AC 68 ms
30,592 KB
testcase_24 AC 66 ms
30,464 KB
testcase_25 AC 68 ms
30,460 KB
testcase_26 AC 69 ms
30,328 KB
testcase_27 AC 323 ms
34,816 KB
testcase_28 AC 66 ms
30,464 KB
testcase_29 AC 70 ms
30,720 KB
testcase_30 AC 66 ms
30,336 KB
testcase_31 AC 70 ms
30,720 KB
testcase_32 AC 321 ms
34,824 KB
testcase_33 AC 65 ms
30,568 KB
testcase_34 AC 311 ms
34,692 KB
testcase_35 AC 62 ms
30,464 KB
testcase_36 AC 62 ms
30,336 KB
testcase_37 AC 67 ms
30,592 KB
testcase_38 AC 63 ms
30,592 KB
testcase_39 AC 70 ms
30,592 KB
testcase_40 AC 68 ms
30,464 KB
testcase_41 AC 327 ms
35,068 KB
testcase_42 AC 69 ms
30,208 KB
testcase_43 AC 69 ms
30,464 KB
testcase_44 AC 69 ms
30,336 KB
testcase_45 AC 69 ms
30,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (632 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System

let sounds d =
    [ d
      d + 2
      d + 4
      d + 5
      d + 7
      d + 9
      d + 11 ]
    |> List.map (fun e -> e % 12)

[<EntryPoint>]
let main _ =
    let n = stdin.ReadLine() |> int
    let t = stdin.ReadLine().Split() |> Array.map int
    let ds =
        [ 0 .. 11 ]
        |> List.filter (fun d ->
            t |> Array.forall (fun u -> sounds d |> List.exists ((=) u)))
    if ds.IsEmpty || ds.Length >= 2 then
        printfn "-1"
    else
        printfn "%d" <| ds.Head
    0
0