結果

問題 No.227 簡単ポーカー
ユーザー chikepluschikeplus
提出日時 2019-01-28 12:36:03
言語 F#
(F# 4.0)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 835 bytes
コンパイル時間 6,603 ms
コンパイル使用メモリ 186,964 KB
実行使用メモリ 32,384 KB
最終ジャッジ日時 2024-04-15 00:21:38
合計ジャッジ時間 8,390 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
32,128 KB
testcase_01 AC 72 ms
32,384 KB
testcase_02 AC 71 ms
31,872 KB
testcase_03 AC 72 ms
32,000 KB
testcase_04 AC 71 ms
31,848 KB
testcase_05 AC 73 ms
32,000 KB
testcase_06 AC 71 ms
32,128 KB
testcase_07 AC 72 ms
32,000 KB
testcase_08 AC 71 ms
32,128 KB
testcase_09 AC 71 ms
31,744 KB
testcase_10 AC 71 ms
31,872 KB
testcase_11 AC 71 ms
31,616 KB
testcase_12 AC 72 ms
31,872 KB
testcase_13 AC 71 ms
32,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (229 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.Collections.Generic
open System.Linq

let getArgs = 
    let args = System.Console.ReadLine().Split( ' ' ):string[]
    seq { for str in args do yield int( str  ) }

let Rank lt = 
    let dict = new Dictionary<int,int>()
    for i in lt do
        match (dict.ContainsKey i) with
        | false -> dict.Add( i , 1)
        | true  -> dict.Item i <- (dict.Item i + 1)

    let dictv = dict.Values.OrderByDescending(fun x -> x).ToArray()
    
    match dict.Keys.Count with
    | 0 -> printfn "NO HAND"
    | 1 -> printfn "NO HAND"
    | _ -> match ( (Array.item 0 dictv) , (Array.item 1 dictv) ) with
            | 3, 2 -> printfn "FULL HOUSE"
            | 3, _ -> printfn "THREE CARD"
            | 2, 2 -> printfn "TWO PAIR"
            | 2, _ -> printfn "ONE PAIR"
            | _, _ -> printfn "NO HAND"

Rank getArgs
0