結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2017-08-11 14:06:12 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 425 ms |
コンパイル使用メモリ | 21,440 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 00:12:54 |
合計ジャッジ時間 | 845 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
let n = 5 let () = let a = Array.make 13 0 in for i = 0 to n - 1 do let x = Scanf.scanf "%d " (fun i -> i) in let x = x - 1 in a.(x) <- a.(x) + 1; done; let s = Array.mem 3 a in let t = Array.mem 2 a in let r = if s && t then "FULL HOUSE" else if s then "THREE CARD" else if not t then "NO HAND" else if Array.fold_left (fun m e -> m + if e = 2 then 1 else 0) 0 a = 2 then "TWO PAIR" else "ONE PAIR" in print_endline r