結果

問題 No.227 簡単ポーカー
ユーザー chuka231
提出日時 2015-10-23 21:44:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 55,424 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-22 11:45:04
合計ジャッジ時間 948 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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