結果

問題 No.227 簡単ポーカー
ユーザー r6ever6eve
提出日時 2017-08-11 14:06:12
言語 OCaml
(5.1.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 471 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 21,576 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 08:39:46
合計ジャッジ時間 835 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0