結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-23 21:44:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 704 bytes |
| コンパイル時間 | 380 ms |
| コンパイル使用メモリ | 54,404 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 11:45:05 |
| 合計ジャッジ時間 | 960 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#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 HAND" << endl;
return 0;
}