結果
問題 | No.227 簡単ポーカー |
ユーザー |
|
提出日時 | 2015-06-22 19:00:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 770 bytes |
コンパイル時間 | 1,495 ms |
コンパイル使用メモリ | 75,592 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 16:38:23 |
合計ジャッジ時間 | 1,511 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef pair<int, int> pii; #define rep(i,x) for(int i=0;i<(int)(x);++i) int main(){ int a, card[13] = {}; rep(i, 5) { cin >> a; ++card[a-1]; } sort(card, card + 13, greater<int>()); if (card[0] == 3) { if (card[1] == 2) cout << "FULL HOUSE" << endl; else cout << "THREE CARD" << endl; } else if (card[1] == 2) { cout << "TWO PAIR" << endl; } else if (card[0] == 2) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }