結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
zaichu
|
| 提出日時 | 2015-12-16 19:15:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 731 bytes |
| コンパイル時間 | 555 ms |
| コンパイル使用メモリ | 59,228 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-16 05:43:48 |
| 合計ジャッジ時間 | 1,180 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 2 |
ソースコード
#include <iostream>
#include <algorithm>
#include <array>
using namespace std;
int main(){
array<int,5> data;
for(int i = 0; i < 5; i++){
cin >> data[i];
}
sort(data.begin(),data.end());
int tmp = data[0];
int check1 = 1,check2 = 1;
bool flag = true;
for(int i = 1; i < 5; i++){
if(data[i] == tmp) check1++;
else {
tmp = data[i];
if(flag){
check2 = check1;
check1 = 1;
flag = false;
}
}
}
int total = check1+check2;
if(total == 5) cout << "FULL HOUSE" << endl;
else if((check1 == 1 || check2 == 1) && total == 4) cout << "THREE CARD" << endl;
else if(total == 4) cout << "TWO PAIR" << endl;
else if(total == 3) cout << "ONE PAIR" << endl;
else cout << "NO HAND" << endl;
return 0;
}
zaichu