結果

問題 No.227 簡単ポーカー
ユーザー hayaDhayaD
提出日時 2016-08-14 07:28:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,319 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 82,828 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 06:31:35
合計ジャッジ時間 1,419 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ISEQ(c) (c).begin(), (c).end()

int main(){
	int A[5];
	int count[14] = {};
	FOR(i,0,5){
		cin >> A[i];
		count[A[i]]++;
	}
	int max = 0;
	FOR(i,1,13){
		if (max < count[i]) max = count[i];
	}

	sort(A,A+5);
	string s = "NO HAND";

	if (max == 1 || max == 4 || max == 5) s = "NO HAND";
	else if(A[0] == A[1] && A[1] == A[2] && A[3] == A[4]) s = "FULL HOUSE";
	else if (A[0] == A[1] && A[2] == A[3] && A[3] == A[4]) s = "FULL HOUSE";
	else if (A[0] == A[1] && A[1] == A[2]) s = "THREE CARD";
	else if (A[1] == A[2] && A[2] == A[3]) s = "THREE CARD";
	else if (A[2] == A[3] && A[3] == A[4]) s = "THREE CARD";
	else if (A[0] == A[1] && A[2] == A[3]) s = "TWO PAIR";
	else if (A[0] == A[1] && A[3] == A[4]) s = "TWO PAIR";
	else if (A[1] == A[2] && A[3] == A[4]) s = "TWO PAIR";
	else if (A[0] == A[1]) s = "ONE PAIR";
	else if (A[1] == A[2]) s = "ONE PAIR";
	else if (A[2] == A[3]) s = "ONE PAIR";
	else if (A[3] == A[4]) s = "ONE PAIR";

	cout << s << endl;
	return 0;
}
0