結果

問題 No.227 簡単ポーカー
ユーザー chuka231chuka231
提出日時 2015-10-23 21:44:04
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 51,640 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-29 17:44:49
合計ジャッジ時間 1,128 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
int a[14];

for(int i=0; i<5; i++) {
int x;
cin >> x;
a[x]++;
}

int three=0, two=0, one=0;

for(int i=1; i<14; i++)
if(a[i]==1) one++;
else if(a[i]==2) two++;
else if(a[i]==3) three++;

if(three==1 && two==1) cout << "FULL HOUSE" << endl;
//ある数をちょうど3つと、別の数をちょうど2つ含む。
else if(three==1) cout << "THREE CARD" << endl;
//ある数をちょうど3つ含む。
else if(two==2) cout << "TWO PAIR" << endl;
//ある数をちょうど2つと、別の数をちょうど2つ含む。
else if (two==1) cout << "ONE PAIR" << endl;
//ある数をちょうど2つ含む。
else cout << "NO HANDS" << endl;

return 0;
}
0