結果

問題 No.227 簡単ポーカー
ユーザー KorishoKorisho
提出日時 2023-07-05 09:03:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,988 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 167,052 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-26 08:21:40
合計ジャッジ時間 3,105 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vc = vector<char>;
using vs = vector<string>;
using pii = pair<int, int>;

/* define short */
#define pb push_back
#define mp make_pair
#define all(obj) obj.begin(), obj.end()
#define bit(n) (1LL<<(n))
#define YESNO(bool) if(bool){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(bool) if(bool){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

/* REP macro */
#define reps(i,a,n) for(ll i = (a); i < (ll)(n); i++)
#define rep(i, n) reps(i,0,n)
#define rrep(i,a,n) for(ll i=n-1;i>=0;i--)

/* func */
inline int in_int() {int x; cin >> x; return x;}
inline ll in_ll() {ll x; cin >> x; return x;}
inline string in_str() {string x; cin >> x; return x;}
// 第一引数と第二引数を比較し、第一引数(a)をより大きい/小さい値に上書き
template <typename T> inline bool chmin(T& a, const T& b) {bool compare = a > b; if (a > b) a = b; return compare;}
template <typename T> inline bool chmax(T& a, const T& b) {bool compare = a < b; if (a < b) a = b; return compare;}

/* global */
const int INF = INT_MAX / 2;
const ll LINF = 1LL << 60;
const ll MOD = 1e9 + 7;


int main(){
	vi A(5);
    rep(i, 5){
        cin >> A[i];
    }
    vi same(5, 0);
    rep(i, 5){
        rep(j, 5){
            if(A[i] == A[j]){
                same[i]++;
            }
        }
    }
    int sum = 0;
    rep(i, 5){
        sum += same[i];
    }
    if(sum == 13){
        cout << "FULL HOUSE" << endl;
    }else if(sum == 11){
        cout << "THREE CARD" << endl;
    }else if(sum == 9){
        cout << "TWO PAIR" << endl;
    }else if(sum == 7){
        cout << "ONE PAIR" << endl;
    }else{
        cout << "NO HAND" << endl;
    }
}
0