結果

問題 No.227 簡単ポーカー
ユーザー commy
提出日時 2017-10-09 23:34:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 685 bytes
コンパイル時間 704 ms
コンパイル使用メモリ 69,864 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 07:10:26
合計ジャッジ時間 1,222 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)

using namespace std;

typedef long long int lli;

int main() {
    int A[13] = {0};
    REP (i, 0, 5) {
        int a;
        cin >> a;
        a--;
        A[a]++;
    }
    int three = 0, two = 0;
    REP (i, 0, 13) {
        if (A[i] == 3) three++;
        else if (A[i] == 2) two++;
    }
    if (three == 1 && two == 1) cout << "FULL HOUSE" << endl;
    else if (three == 1) cout << "THREE CARD" << endl;
    else if (two == 2) cout << "TWO PAIR" << endl;
    else if (two == 1) cout << "ONE PAIR" << endl;
    else cout << "NO HAND" << endl;

    return 0;
}
0