結果

問題 No.227 簡単ポーカー
ユーザー maimai8maimai8
提出日時 2020-08-02 19:23:58
言語 OCaml
(5.1.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 626 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 21,448 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 09:08:11
合計ジャッジ時間 823 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 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
権限があれば一括ダウンロードができます
コンパイルメッセージ
File "Main.ml", lines 3-9, characters 2-18:
3 | ..let [a;b;c;d;e] = List.fast_sort compare lst in
4 |   Printf.printf "%s\n"
5 |   (if a = b && b = c && c <> d && d = e || a = b && b <> c && c = d && d = e then "FULL HOUSE"
6 |    else if (a = b && b = c && c <> d) || (a <> b && b = c && c = d && d <> e) || (b <> c && c = d && d = e) then "THREE CARD"
7 |    else if a = b && b <> c && c = d || a = b && c <> d && d = e || a <> b && b = c && d = e then "TWO PAIR"
8 |    else if a = b && b <> c || a <>b && b = c && c <> d || b <> c && c = d && d <> e || c <> d && d = e then "ONE PAIR"
9 |    else "NO HAND")
Warning 8 [partial-match]: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
a::b::c::d::e::_::_

ソースコード

diff #

let () =
  let lst = Scanf.scanf "%d %d %d %d %d\n" @@ fun a b c d e -> [a;b;c;d;e] in
  let [a;b;c;d;e] = List.fast_sort compare lst in
  Printf.printf "%s\n"
  (if a = b && b = c && c <> d && d = e || a = b && b <> c && c = d && d = e then "FULL HOUSE"
   else if (a = b && b = c && c <> d) || (a <> b && b = c && c = d && d <> e) || (b <> c && c = d && d = e) then "THREE CARD"
   else if a = b && b <> c && c = d || a = b && c <> d && d = e || a <> b && b = c && d = e then "TWO PAIR"
   else if a = b && b <> c || a <>b && b = c && c <> d || b <> c && c = d && d <> e || c <> d && d = e then "ONE PAIR"
   else "NO HAND")
0