結果

問題 No.227 簡単ポーカー
ユーザー chiyoda
提出日時 2016-06-27 01:37:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 59,740 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 22:21:02
合計ジャッジ時間 1,312 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int cnt[14] = {};
  for (int i = 0; i < 5; ++i) {
    int tmp;
    cin >> tmp;
    cnt[tmp]++;
  }
  sort(cnt, cnt + 14);
  string res;
  if (cnt[13] == 3) {
    if (cnt[12] == 2) res = "FULL HOUSE";
    else res = "THREE CARD"; 
  } else if (cnt[13] == 2) {
    if (cnt[12] == 2) res = "TWO PAIR"; 
    else res = "ONE PAIR"; 
  } else {
    res = "NO HAND";
  }
  cout << res << endl;
}
0