結果

問題 No.227 簡単ポーカー
ユーザー hotpepsihotpepsi
提出日時 2015-12-04 01:29:06
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 544 bytes
コンパイル時間 716 ms
コンパイル使用メモリ 61,236 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-12 13:19:08
合計ジャッジ時間 1,615 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <cstdio>

using namespace std;

int main(int argc, char *argv[])
{
	int cnt[14] = {};
	for (int i = 0; i < 5; ++i) {
		int a;
		cin >> a;
		cnt[a] += 1;
	}
	int pairs = 0, three = 0;
	for (int i = 1; i <= 13; ++i) {
		pairs += cnt[i] == 2;
		three += cnt[i] == 3;
	}
	string ans = "NO HAND";
	if (three) {
		ans = pairs ? "FULL HOUSE" : "THREE CARD";
	} else if (pairs) {
		ans = pairs >= 2 ? "TWO PAIR" : "ONE PAIR";
	}
	cout << ans << endl;
	return 0;
}
0