結果

問題 No.227 簡単ポーカー
ユーザー fshutofshuto
提出日時 2019-04-29 21:41:05
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 298 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,232 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-08-26 19:29:00
合計ジャッジ時間 2,175 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 84 ms
15,272 KB
testcase_02 AC 77 ms
15,040 KB
testcase_03 AC 76 ms
15,076 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 76 ms
15,256 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 79 ms
15,252 KB
testcase_13 AC 79 ms
15,156 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 c1 == 1
  puts 'ONE PAIR'
else
  puts 'NO HAND'
end
0