結果

問題 No.227 簡単ポーカー
ユーザー kasajeikasajei
提出日時 2018-09-24 17:39:11
言語 Ruby
(3.3.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 11,908 KB
実行使用メモリ 16,100 KB
最終ジャッジ日時 2023-10-23 18:29:45
合計ジャッジ時間 2,480 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
16,100 KB
testcase_01 AC 81 ms
16,096 KB
testcase_02 AC 86 ms
16,100 KB
testcase_03 AC 83 ms
16,100 KB
testcase_04 AC 82 ms
16,100 KB
testcase_05 AC 82 ms
16,100 KB
testcase_06 AC 82 ms
16,100 KB
testcase_07 AC 82 ms
16,100 KB
testcase_08 AC 84 ms
16,100 KB
testcase_09 AC 82 ms
16,100 KB
testcase_10 AC 83 ms
16,100 KB
testcase_11 AC 81 ms
16,096 KB
testcase_12 AC 81 ms
16,100 KB
testcase_13 AC 82 ms
16,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = gets.chomp.split.map(&:to_i)
count = Hash.new(0)
a.each do |v|
  count[v] += 1
end

three_pair = 0
two_pair = 0
count.each do |key, value|
  if value == 3
    three_pair += 1
  elsif value ==2
    two_pair += 1
  end
end

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