結果

問題 No.227 簡単ポーカー
ユーザー ajiruajiru
提出日時 2020-02-05 21:11:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 535 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 70,336 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 23:23:12
合計ジャッジ時間 1,400 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(void) {
	vector<int> cards(13, 0);
	int a;
	for (int i = 0; i < 5; ++i) {
		cin >> a;
		--a;
		++cards[a];
	}
	int two = 0, three = 0;
	for (int i = 0; i < 13; ++i) {
		if (cards[i] == 2) ++two;
		else if (cards[i] == 3) ++three;
	}
	string ans = "NO HAND";
	if (three == 1 && two == 1)
		ans = "FULL HOUSE";
	else if (three == 1)
		ans = "THREE CARD";
	else if (two == 2)
		ans = "TWO PAIR";
	else if (two == 1)
		ans = "ONE PAIR";
	cout << ans << endl;
	return 0;
}
0