結果

問題 No.227 簡単ポーカー
ユーザー はっさん
提出日時 2016-11-30 00:19:22
言語 Ruby
(3.4.1)
結果
AC  
実行時間 91 ms / 5,000 ms
コード長 379 bytes
コンパイル時間 37 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-27 13:51:32
合計ジャッジ時間 1,709 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

cards = [*1..13]
N = gets.split.map(&:to_i)

match_count = []

cards.each { |card| match_count[card] = N.count(card) }
  
if match_count.include?(3)
  if match_count.include?(2)
    print 'FULL HOUSE'
  else
    print 'THREE CARD'
  end
elsif match_count.include?(2)
  if match_count.count(2) == 2
    print 'TWO PAIR'
  else
    print 'ONE PAIR'
  end
else
  print 'NO HAND'
end
0