結果

問題 No.227 簡単ポーカー
ユーザー harhogefooharhogefoo
提出日時 2016-10-13 07:51:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,452 KB
実行使用メモリ 15,312 KB
最終ジャッジ日時 2023-08-14 08:31:15
合計ジャッジ時間 1,983 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,312 KB
testcase_01 AC 83 ms
15,176 KB
testcase_02 AC 83 ms
15,288 KB
testcase_03 AC 79 ms
15,216 KB
testcase_04 AC 81 ms
15,224 KB
testcase_05 AC 81 ms
15,232 KB
testcase_06 AC 80 ms
15,036 KB
testcase_07 AC 81 ms
15,212 KB
testcase_08 AC 82 ms
15,172 KB
testcase_09 AC 80 ms
15,148 KB
testcase_10 AC 81 ms
15,120 KB
testcase_11 AC 79 ms
15,300 KB
testcase_12 AC 80 ms
15,068 KB
testcase_13 AC 78 ms
15,260 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.chomp.split(" ")

h = Hash.new(0)
a.each do |card|
  h[card] += 1
end

three_card = false
two_pair_count = 0
h.each do |card, count|
  three_card = true if count == 3
  two_pair_count += 1 if count == 2
end

if three_card and two_pair_count == 1
  puts "FULL HOUSE"
elsif three_card
  puts "THREE CARD"
elsif two_pair_count == 2
  puts "TWO PAIR"
elsif two_pair_count == 1
  puts "ONE PAIR"
else
  puts "NO HAND"
end
0