結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー shin2
提出日時 2026-07-12 16:25:54
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 281µs
コード長 743 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 961 ms
コンパイル使用メモリ 168,124 KB
実行使用メモリ 9,348 KB
最終ジャッジ日時 2026-07-12 16:26:10
合計ジャッジ時間 2,241 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int main(){
    int a[5];
    string e = "";

    for(int i = 0;i < 5;i++){
        cin >> a[i];
    }

    sort(a,a+5);

    for(int i = 0;i < 4;i++){
        if(a[i] == a[i+1]){
            e += "o";
        }else{
            e += "x";
        }
    }

    if(e == "ooxo" || e == "oxoo"){
        cout << "FULL HOUSE" << endl;
    }else if(e == "ooxx" || e == "xoox" || e == "xxoo"){
        cout << "THREE CARD" << endl;
    }else if(e == "oxox" || e == "oxxo" || e == "xoxo"){
        cout << "TWO PAIR" << endl;
    }else if(e == "oxxx" || e == "xoxx" || e == "xxox" || e == "xxxo"){
        cout << "ONE PAIR" << endl;
    }else{
        cout << "NO HAND" << endl;
    }

}
0