結果

問題 No.227 簡単ポーカー
ユーザー ミドリムシミドリムシ
提出日時 2017-10-14 01:40:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 60,352 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 17:59:51
合計ジャッジ時間 1,163 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
	int cards[5];
	for(int i = 0; i < 5; i++){
		cin >> cards[i];
	}
	sort(cards, cards + 5);
	int continuity = 1;
	int num = cards[0];
	int card3 = 0, card2 = 0;
	for(int i = 1; i < 5; i++){
		if(cards[i] == num){
			continuity++;
		}else{
			if(continuity == 2){
				card2++;
			}else if(continuity == 3){
				card3++;
			}
			continuity = 1;
			num = cards[i];
		}
	}
	if(card3 && card2){
		cout << "FULL HOUSE" << endl;
	}else if(card3){
		cout << "THREE CARD" << endl;
	}else if(card2 == 2){
		cout << "TWO PAIR" << endl;
	}else if(card2 == 1){
		cout << "ONE PAIR" << endl;
	}else{
		cout << "NO HAND" << endl;
	}
}
0