結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2017-08-22 20:25:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 57,144 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 04:26:12 |
合計ジャッジ時間 | 965 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream> #include <string> using namespace std; int a[14]; bool three_card, two_pair, one_pair; int main() { int n; for (int i = 0; i < 5; i++) { cin >> n; a[n]++; } for (int i = 1; i <= 13; i++) { if (a[i] == 3) three_card = true; else if (a[i] == 2) { if (one_pair) two_pair = true; else one_pair = true; } } string ans = "NO HAND"; if (three_card && one_pair) ans = "FULL HOUSE" ; else if (three_card) ans = "THREE CARD"; else if (two_pair) ans = "TWO PAIR"; else if (one_pair) ans = "ONE PAIR"; cout << ans << endl; }