結果

問題 No.24 数当てゲーム
ユーザー hum_ophum_op
提出日時 2016-04-16 15:36:12
言語 F#
(.NET 7)
結果
AC  
実行時間 92 ms / 5,000 ms
コード長 747 bytes
コンパイル時間 3,662 ms
コンパイル使用メモリ 165,900 KB
実行使用メモリ 23,180 KB
最終ジャッジ日時 2023-07-27 14:28:31
合計ジャッジ時間 5,603 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
23,052 KB
testcase_01 AC 90 ms
23,180 KB
testcase_02 AC 90 ms
23,092 KB
testcase_03 AC 89 ms
23,116 KB
testcase_04 AC 90 ms
23,116 KB
testcase_05 AC 90 ms
22,940 KB
testcase_06 AC 90 ms
23,176 KB
testcase_07 AC 92 ms
23,116 KB
testcase_08 AC 91 ms
23,000 KB
testcase_09 AC 88 ms
23,092 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 No24 () =
    let N = int <| Console.ReadLine()
    let A = Array.create 10 0
    let yes n =
        if A.[n] <> -1 then
            A.[n] <- A.[n] + 1

        ()

    let rec max i m =
        if i < 10 then
            if A.[i] > m then
                max (i + 1) A.[i]
            else
                max (i + 1) m
        else
            m

    for i in 0..N-1 do
        let IN = Console.ReadLine().Split(' ')
        let L = [ for i in 0..3 -> Int32.Parse IN.[i] ]
        if IN.[4] = "YES" then
            L |> List.iter yes
        else
            L |> List.iter (fun e -> A.[e] <- -1)
    
    let m = max 0 0
    A
    |> Array.findIndex (fun e-> if e = m then true else false)
    |> printfn "%d"

    ()
No24 ()
0