結果

問題 No.227 簡単ポーカー
ユーザー chikeplus
提出日時 2019-01-28 12:28:25
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 694 bytes
コンパイル時間 6,686 ms
コンパイル使用メモリ 189,088 KB
実行使用メモリ 37,248 KB
最終ジャッジ日時 2024-10-04 06:00:08
合計ジャッジ時間 9,170 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 RE * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (226 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 ( (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