結果

問題 No.227 簡単ポーカー
ユーザー yukiteruyukiteru
提出日時 2017-10-22 14:41:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,027 bytes
コンパイル時間 735 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-01 10:16:18
合計ジャッジ時間 1,388 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>
#include<list>
#include<bitset>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000

using namespace std;


int main(void) {
	int a[5];
	int flag[4] = {};
	int dp = -1;
	int p, r;

	FOR(i, 0, 4) {
		cin >> a[i];
	}
	sort(a, a + 5);
	FOR(i, 0, 4) {
		cout << a[i] << endl;
	}
	p = 1;
	r = a[0];
	FOR(i, 1, 4) {
		if (a[i] == r) {
			p++;
		}
		else {
			r = a[i];
			
			if (p == 2) {
				flag[2]++;
			}
			if (p == 3) {
				flag[3]++;
			}
			p = 1;
		}
	}
	if (flag[2] == 1 && flag[3] == 1) {
		cout << "FULL HOUSE" << endl;
	}
	else if (flag[3] == 1) {
		cout << "THREE CARD" << endl;
	}
	else if (flag[2] == 2) {
		cout << "TWO PAIR" << endl;
	}
	else if (flag[2] == 1) {
		cout << "ONE PAIR" << endl;
	}
	else {
		cout << "NO HAND" << endl;
	}
	return 0;
}
0