結果

問題 No.227 簡単ポーカー
ユーザー nonokai10nonokai10
提出日時 2018-03-02 17:17:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 15,320 KB
最終ジャッジ日時 2023-09-02 09:46:41
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,044 KB
testcase_01 AC 82 ms
15,168 KB
testcase_02 AC 80 ms
15,156 KB
testcase_03 AC 80 ms
15,088 KB
testcase_04 AC 78 ms
15,268 KB
testcase_05 AC 83 ms
15,176 KB
testcase_06 AC 81 ms
15,116 KB
testcase_07 AC 80 ms
15,092 KB
testcase_08 AC 82 ms
15,284 KB
testcase_09 AC 80 ms
15,320 KB
testcase_10 AC 81 ms
15,256 KB
testcase_11 AC 79 ms
15,228 KB
testcase_12 AC 78 ms
15,212 KB
testcase_13 AC 80 ms
15,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

hands = gets.split.map(&:to_i)
hash = Hash.new(0)
hands.each do |val|
  hash[val] += 1
end

if hash.values.max == 3
  if hash.values.include?(2)
    puts 'FULL HOUSE'
  else
    puts 'THREE CARD'
  end
elsif hash.values.max == 2
  if hash.values.count(2) == 2
    puts 'TWO PAIR'
  else
    puts 'ONE PAIR'
  end
else
  puts 'NO HAND'
end
0