No.227 Easy Poker
タグ : / 解いたユーザー数 878
作問者 :
data9824
Problem Statement
You are dealt 5 cards. Each card has an integer between 1 and 13, inclusive, written on it. The hand is determined by the combination of integers written on the cards.
Determine which of the following hands the 5 dealt cards correspond to. If they correspond to multiple hands, they are considered to correspond to the one listed first below.
- FULL HOUSE
- Contains exactly 3 of one number and exactly 2 of another number.
- THREE CARD
- Contains exactly 3 of one number.
- TWO PAIR
- Contains exactly 2 of one number and exactly 2 of another number.
- ONE PAIR
- Contains exactly 2 of one number.
Input
\(A_1\) \(A_2\) \(A_3\) \(A_4\) \(A_5\)
\(A_i (1 \leq i \leq 5) \) are the integers written on the dealt cards. \( (1 \leq A_i \leq 13) \)
Output
Print the name of the corresponding hand. If the cards do not correspond to any hand, print NO HAND. Print a newline at the end.
That is, the output is one of the following.
FULL HOUSE
THREE CARD
TWO PAIR
ONE PAIR
NO HAND
Sample
Sample 1
Input
5 6 5 6 5
Output
FULL HOUSE
There are three 5s and two 6s, so the hand is FULL HOUSE.
Sample 2
Input
5 6 5 7 5
Output
THREE CARD
There are three 5s, so the hand is THREE CARD.
Sample 3
Input
5 6 5 6 7
Output
TWO PAIR
There are two 5s and two 6s, so the hand is TWO PAIR.
Sample 4
Input
5 6 5 7 8
Output
ONE PAIR
There are two 5s, so the hand is ONE PAIR.
Sample 5
Input
5 6 7 8 9
Output
NO HAND
The cards do not correspond to any hand.
Sample 6
Input
5 5 5 5 5
Output
NO HAND
The cards do not correspond to any hand.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。