結果

問題 No.24 数当てゲーム
ユーザー kuuso1kuuso1
提出日時 2016-08-19 01:59:06
言語 F#
(F# 4.0)
結果
AC  
実行時間 314 ms / 5,000 ms
コード長 714 bytes
コンパイル時間 6,137 ms
コンパイル使用メモリ 200,148 KB
実行使用メモリ 34,332 KB
最終ジャッジ日時 2024-04-25 09:06:59
合計ジャッジ時間 10,150 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 314 ms
34,108 KB
testcase_01 AC 301 ms
33,836 KB
testcase_02 AC 302 ms
33,980 KB
testcase_03 AC 300 ms
33,848 KB
testcase_04 AC 300 ms
33,988 KB
testcase_05 AC 305 ms
33,728 KB
testcase_06 AC 299 ms
33,980 KB
testcase_07 AC 301 ms
34,112 KB
testcase_08 AC 302 ms
34,332 KB
testcase_09 AC 301 ms
33,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (206 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(9,19): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '"a"' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        
        let ar = Array.create 10 true
        let N = stdin.ReadLine() |> int
        for i = 0 to (N-1) do
            let S = stdin.ReadLine().Split()
            match S.[4] with 
            | "NO" -> 
             (
                 for j = 0 to 3 do
                     ar.[int S.[j]] <- false
             )
            | "YES" -> 
             (
                 for j = 0 to 9 do
                     if (j <> (int S.[0])) && (j <> (int S.[1])) && (j <> (int S.[2])) && (j <> (int S.[3])) then ar.[j] <- false
             )
        
        Array.findIndex (fun e -> e = true ) ar |> printfn "%d"
        
let mySol = new Sol()
mySol.Solve()
0