結果

問題 No.227 簡単ポーカー
ユーザー q_va629q_va629
提出日時 2019-05-30 09:41:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 477 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 64,244 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 18:50:10
合計ジャッジ時間 1,313 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
	int a, b[13] = { 0 }, f = 0;
	for (int i = 0; i < 5; ++i){
		cin >> a;
		b[a - 1]++;
		if (b[a - 1] == 2) f++;
		if (b[a - 1] == 3) f += 2;
		if (b[a - 1] == 4) f -= 3;
	}
	switch (f){
	case 0: cout << "NO HAND" << endl; break;
	case 1: cout << "ONE PAIR" << endl; break;
	case 2: cout << "TWO PAIR" << endl; break;
	case 3: cout << "THREE CARD" << endl; break;
	case 4: cout << "FULL HOUSE" << endl; break;
	}
	return 0;
}
0