結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー hotpepsi
提出日時 2015-12-04 01:29:06
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 285µs
コード長 544 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 308 ms
コンパイル使用メモリ 75,136 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-27 03:06:05
合計ジャッジ時間 2,051 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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