結果

問題 No.227 簡単ポーカー
ユーザー トミー
提出日時 2024-01-15 20:40:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 542 bytes
コンパイル時間 2,910 ms
コンパイル使用メモリ 199,504 KB
最終ジャッジ日時 2025-02-18 20:13:16
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    map<int,int> cards;
    vector<int> p(4,0);
    for(int i=1;i<=5;i++){
        int c;
        cin>>c;
        cards[c]++;
    }
    for(auto [num,cnt]:cards){
        p[cnt]++;
    }
    if(p[3]&&p[2]){
        cout<<"FULL HOUSE";
    }
    else if(p[3]){
        cout<<"THREE CARD";
    }
    else if(p[2]>=2){
        cout<<"TWO PAIR";
    }
    else if(p[2]){
        cout<<"ONE PAIR";
    }
    else{
        cout<<"NO HAND";
    }
    cout<<endl;


    //system("pause");
} 
0