結果

問題 No.227 簡単ポーカー
ユーザー 久保喬平
提出日時 2024-12-26 19:30:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 633 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-26 19:30:11
合計ジャッジ時間 1,448 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    """
    5 6 5 6 9
    """
    cards = list(map(int, input().split(' ')))
    card_set = set(cards) # {5, 6}, {5, 6, 9}
    num_counts = len(card_set) # 2, 3
    target_numbers = [cards.count(card) for card in card_set] # [3, 2] [3, 1, 1], [2, 2, 1]
    if (num_counts == 2) and (3 in target_numbers):
        print('FULL HOUSE')
    elif (num_counts == 3) and (3 in target_numbers):
        print('THREE CARD')
    elif (num_counts == 3) and (2 in target_numbers):
        print("TWO PAIR")
    elif num_counts == 4:
        print("ONE PAIR")
    else:
        print("NO HAND")

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