問題一覧 > 通常問題

No.227 Easy Poker

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 878
作問者 : data9824
お気に入りにしたユーザー ProblemId : 562 / 自分の提出
問題文最終更新日: 2026-06-25 17:57:33
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 111 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。