// No.227 簡単ポーカー // https://yukicoder.me/problems/no/227 // #include #include #include using namespace std; string solve(vector& cards); int main() { vector cards(5); for (auto i = 0; i < 5; i++) { cin >> cards[i]; } string ans = solve(cards); cout << ans << endl; } string solve(vector& cards) { unordered_map hand; for (auto c: cards) { if (hand.find(c) != hand.end()) hand[c]++; else hand[c] = 1; } int three_card = 0; int one_pair = 0; for (auto h: hand) { if (h.second == 3) three_card++; else if (h.second == 2) one_pair++; } if (three_card && one_pair) return "FULL HOUSE"; else if (three_card) return "THREE CARD"; else if (one_pair == 2) return "TWO PAIR"; else if (one_pair == 1) return "ONE PAIR"; return "NO HAND"; }