結果

問題 No.227 簡単ポーカー
ユーザー fshutofshuto
提出日時 2019-04-29 21:42:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 298 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 11,228 KB
実行使用メモリ 15,288 KB
最終ジャッジ日時 2023-08-26 19:29:03
合計ジャッジ時間 2,047 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,280 KB
testcase_01 AC 73 ms
15,260 KB
testcase_02 AC 75 ms
15,088 KB
testcase_03 AC 76 ms
15,008 KB
testcase_04 AC 75 ms
15,112 KB
testcase_05 AC 74 ms
15,168 KB
testcase_06 AC 76 ms
15,288 KB
testcase_07 AC 73 ms
15,232 KB
testcase_08 AC 75 ms
15,232 KB
testcase_09 AC 77 ms
15,144 KB
testcase_10 AC 75 ms
15,208 KB
testcase_11 AC 75 ms
15,032 KB
testcase_12 AC 75 ms
15,144 KB
testcase_13 AC 77 ms
15,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

cs = Hash.new(0)
gets.split.map(&:to_i).each do |a|
  cs[a] += 1
end
c3 = cs.count { |k,v| v == 3 }
c2 = cs.count { |k,v| v == 2 }

if c3 == 1 && c2 == 1
  puts 'FULL HOUSE'
elsif c3 == 1
  puts 'THREE CARD'
elsif c2 == 2
  puts 'TWO PAIR'
elsif c2 == 1
  puts 'ONE PAIR'
else
  puts 'NO HAND'
end
0