結果

問題 No.227 簡単ポーカー
ユーザー halship
提出日時 2018-09-10 16:13:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 832 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 59,780 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 23:12:14
合計ジャッジ時間 1,367 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#define repeat(i,n) for(int i = 0; (i) < (n); ++ (i))
using namespace std;

int main() {
    vector<int> num(13, 0);

    int a;
    repeat(i,5) {
        cin >> a;
        ++num[a - 1];
    }

    bool is_three = false;
    int two_num = 0;
    repeat(i,13) {
        if (num[i] == 3) {
            is_three = true;
        } else if (num[i] == 2) {
            ++two_num;
        }
    }

    if (is_three) {
        if (two_num == 1) {
            cout << "FULL HOUSE" << endl;
        } else {
            cout << "THREE CARD" << endl;
        }
    } else {
        if (two_num == 2) {
            cout << "TWO PAIR" << endl;
        } else if (two_num == 1) {
            cout << "ONE PAIR" << endl;
        } else {
            cout << "NO HAND" << endl;
        }
    }

    return 0;
}
0