結果

問題 No.1109 調の判定
ユーザー ikdikd
提出日時 2020-07-10 23:02:58
言語 F#
(.NET 7)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 4,307 ms
コンパイル使用メモリ 165,420 KB
実行使用メモリ 25,156 KB
最終ジャッジ日時 2023-08-01 22:25:42
合計ジャッジ時間 9,574 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
25,156 KB
testcase_01 AC 70 ms
22,548 KB
testcase_02 AC 71 ms
24,612 KB
testcase_03 AC 85 ms
23,160 KB
testcase_04 AC 84 ms
23,084 KB
testcase_05 AC 85 ms
23,100 KB
testcase_06 AC 70 ms
24,484 KB
testcase_07 AC 69 ms
22,508 KB
testcase_08 AC 85 ms
25,112 KB
testcase_09 AC 86 ms
25,084 KB
testcase_10 AC 84 ms
23,068 KB
testcase_11 AC 70 ms
22,672 KB
testcase_12 AC 71 ms
24,488 KB
testcase_13 AC 70 ms
22,620 KB
testcase_14 AC 70 ms
22,500 KB
testcase_15 AC 70 ms
22,556 KB
testcase_16 AC 70 ms
22,492 KB
testcase_17 AC 69 ms
22,508 KB
testcase_18 AC 70 ms
24,544 KB
testcase_19 AC 71 ms
24,576 KB
testcase_20 AC 70 ms
20,464 KB
testcase_21 AC 70 ms
22,584 KB
testcase_22 AC 73 ms
24,596 KB
testcase_23 AC 70 ms
22,664 KB
testcase_24 AC 70 ms
24,660 KB
testcase_25 AC 71 ms
24,584 KB
testcase_26 AC 71 ms
22,548 KB
testcase_27 AC 85 ms
23,048 KB
testcase_28 AC 70 ms
24,496 KB
testcase_29 AC 70 ms
20,536 KB
testcase_30 AC 70 ms
22,612 KB
testcase_31 AC 71 ms
24,656 KB
testcase_32 AC 85 ms
25,112 KB
testcase_33 AC 73 ms
20,492 KB
testcase_34 AC 85 ms
25,132 KB
testcase_35 AC 71 ms
22,716 KB
testcase_36 AC 70 ms
22,552 KB
testcase_37 AC 70 ms
22,536 KB
testcase_38 AC 71 ms
22,716 KB
testcase_39 AC 71 ms
22,592 KB
testcase_40 AC 70 ms
22,528 KB
testcase_41 AC 85 ms
22,972 KB
testcase_42 AC 71 ms
24,520 KB
testcase_43 AC 70 ms
22,504 KB
testcase_44 AC 70 ms
22,548 KB
testcase_45 AC 71 ms
24,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

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