結果

問題 No.227 簡単ポーカー
ユーザー chikepluschikeplus
提出日時 2019-01-28 12:28:25
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 694 bytes
コンパイル時間 7,325 ms
コンパイル使用メモリ 186,308 KB
実行使用メモリ 37,376 KB
最終ジャッジ日時 2024-04-14 23:57:12
合計ジャッジ時間 9,110 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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