結果

問題 No.24 数当てゲーム
ユーザー hum_ophum_op
提出日時 2016-04-16 15:36:12
言語 F#
(F# 4.0)
結果
AC  
実行時間 343 ms / 5,000 ms
コード長 747 bytes
コンパイル時間 6,104 ms
コンパイル使用メモリ 187,220 KB
実行使用メモリ 36,208 KB
最終ジャッジ日時 2024-04-15 02:11:19
合計ジャッジ時間 10,121 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 316 ms
35,824 KB
testcase_01 AC 314 ms
36,060 KB
testcase_02 AC 311 ms
35,988 KB
testcase_03 AC 307 ms
35,564 KB
testcase_04 AC 343 ms
36,208 KB
testcase_05 AC 309 ms
35,820 KB
testcase_06 AC 306 ms
35,828 KB
testcase_07 AC 313 ms
35,996 KB
testcase_08 AC 311 ms
35,984 KB
testcase_09 AC 306 ms
35,844 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (212 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 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