結果

問題 No.24 数当てゲーム
ユーザー chike_pluschike_plus
提出日時 2019-03-26 09:47:58
言語 F#
(F# 4.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 717 bytes
コンパイル時間 7,184 ms
コンパイル使用メモリ 199,736 KB
実行使用メモリ 29,824 KB
最終ジャッジ日時 2024-04-19 08:40:10
合計ジャッジ時間 8,181 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
29,440 KB
testcase_01 AC 56 ms
29,440 KB
testcase_02 AC 55 ms
29,824 KB
testcase_03 AC 56 ms
29,696 KB
testcase_04 AC 56 ms
29,696 KB
testcase_05 AC 54 ms
29,696 KB
testcase_06 AC 54 ms
29,440 KB
testcase_07 AC 54 ms
29,568 KB
testcase_08 AC 54 ms
29,440 KB
testcase_09 AC 55 ms
29,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (228 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 |> stdout.WriteLine
        
let mySol = new Sol()
mySol.Solve()
0