結果

問題 No.227 簡単ポーカー
ユーザー kuuso1kuuso1
提出日時 2016-08-18 17:29:08
言語 F#
(F# 4.0)
結果
AC  
実行時間 96 ms / 5,000 ms
コード長 634 bytes
コンパイル時間 3,857 ms
コンパイル使用メモリ 167,956 KB
実行使用メモリ 25,328 KB
最終ジャッジ日時 2023-08-07 15:13:11
合計ジャッジ時間 5,667 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
23,224 KB
testcase_01 AC 94 ms
25,280 KB
testcase_02 AC 94 ms
21,216 KB
testcase_03 AC 94 ms
23,332 KB
testcase_04 AC 96 ms
23,496 KB
testcase_05 AC 96 ms
25,328 KB
testcase_06 AC 90 ms
25,244 KB
testcase_07 AC 95 ms
23,232 KB
testcase_08 AC 91 ms
23,200 KB
testcase_09 AC 95 ms
21,252 KB
testcase_10 AC 95 ms
23,316 KB
testcase_11 AC 95 ms
23,308 KB
testcase_12 AC 96 ms
23,316 KB
testcase_13 AC 95 ms
23,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        let As = stdin.ReadLine().Split() |> Array.map int
        
        let hs = As |> Seq.countBy (fun e -> e) |> Seq.sortWith (fun p q -> (snd p).CompareTo(snd q)) |> Seq.rev |> Seq.toArray
        
        let judgeHands (ha: (int*int) array) =
            match (Array.length ha) with
            | 4 -> "ONE PAIR"
            | 2 -> if (snd ha.[0]) = 3 then "FULL HOUSE" else "NO HAND"
            | 3 -> if (snd ha.[0]) = 3 then "THREE CARD" else "TWO PAIR"
            | _ -> "NO HAND"

        judgeHands hs |> printfn "%s"
        

let mySol = new Sol()
mySol.Solve()
0