結果

問題 No.227 簡単ポーカー
ユーザー Daiki_000
提出日時 2024-12-19 18:59:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 776 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-19 18:59:11
合計ジャッジ時間 1,827 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

def determine_role(hand_counts):
    if len(hand_counts) == 2:
        if hand_counts[0] == 2 and hand_counts[1] == 3:
            return "FULL HOUSE"
        elif hand_counts[0] == 2 and hand_counts[1] == 2:
            return "TWO PAIR"
    elif len(hand_counts) == 1:
        if hand_counts[0] == 3:
            return "THREE CARD"
        elif hand_counts[0] == 2:
            return "ONE PAIR"
        else:
            return "NO HAND"


def main():
    cards = sorted(list(map(int, input().split())))
    hand = list(set(cards))
    hand_counts = [cards.count(role) for role in hand]
    hand_counts = sorted([pair_card for pair_card in hand_counts if pair_card != 1])

    result = determine_role(hand_counts)
    print(result)


if __name__ == "__main__":
    main()
0