結果

問題 No.227 簡単ポーカー
ユーザー eiji0313eiji0313
提出日時 2018-01-03 03:21:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 668 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-08-24 17:11:19
合計ジャッジ時間 1,043 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 AC 15 ms
7,832 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,800 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 15 ms
7,852 KB
testcase_09 AC 16 ms
7,816 KB
testcase_10 AC 15 ms
7,868 KB
testcase_11 AC 15 ms
7,980 KB
testcase_12 AC 15 ms
7,820 KB
testcase_13 AC 14 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = [int(x) for x in input().split()]

hands = {}
for i in range(1, 14):
    hands[i] = 0
for i in a:
    hands[i] += 1

rank = ""
flg3 = False
flg2 = False
for i in hands.keys():
    if hands[i] == 4 or hands[i] == 5:
        break
    elif hands[i] == 3:
        if flg2:
            rank = "FULL HOUSE"
            break
        flg3 = True
    elif hands[i] == 2:
        if flg2:
            rank = "TWO PAIR"
            break
        elif flg3:
            rank = "FULL HOUSE"
            break
        flg2 = True

if rank == "":
    if flg2:
        rank = "ONE PAIR"
    elif flg3:
        rank = "THREE CARD"
    else:
        rank = "NO HAND"

print(rank)
0