結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2016-08-18 17:29:08 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 87 ms / 5,000 ms |
コード長 | 634 bytes |
コンパイル時間 | 12,878 ms |
コンパイル使用メモリ | 188,772 KB |
実行使用メモリ | 31,872 KB |
最終ジャッジ日時 | 2024-11-07 19:27:05 |
合計ジャッジ時間 | 14,602 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (247 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/
ソースコード
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()