結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
Yang33
|
| 提出日時 | 2016-01-02 22:28:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 974 bytes |
| コンパイル時間 | 598 ms |
| コンパイル使用メモリ | 54,364 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 10:38:54 |
| 合計ジャッジ時間 | 1,272 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include<iostream>
using namespace std;
int main(void)
{//バカの手法って感じ、絶対にいい方法がありそう,
//フラグとか
int i,s,temp, test[5];
for (i = 0; i < 5;i++)
cin >> test[i];
for (i = 0; i < 5; ++i) {
for (int s = 4; s > i; --s) {
if (test[s] < test[s - 1]) {
temp = test[s - 1];
test[s - 1] = test[s];
test[s] = temp;
}
}
}
if (test[0] == test[3] || test[1] ==test[4])
cout << "NO HAND";
else if (test[0] == test[1] && test[2] == test[4] || test[0] == test[2] && test[3] == test[4])
cout << "FULL HOUSE";
else if (test[0] == test[2] || test[1] == test[3] || test[2] == test[4])
cout << "THREE CARD";
else if (test[0] == test[1] && (test[2] == test[3] || test[3] == test[4]) || test[1] == test[2] && test[3] == test[4])
cout << "TWO PAIR";
else if (test[0] == test[1] || test[1] == test[2] || test[2] == test[3] || test[3] == test[4])
cout << "ONE PAIR";
else cout << "NO HAND";
return 0;
}
Yang33