結果

問題 No.227 簡単ポーカー
ユーザー sassysassy
提出日時 2023-07-06 16:06:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 812 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 11,028 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2023-09-27 17:04:29
合計ジャッジ時間 1,185 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,912 KB
testcase_01 AC 14 ms
7,776 KB
testcase_02 AC 13 ms
7,828 KB
testcase_03 AC 14 ms
7,736 KB
testcase_04 AC 15 ms
7,832 KB
testcase_05 AC 13 ms
7,732 KB
testcase_06 AC 13 ms
7,928 KB
testcase_07 AC 13 ms
7,820 KB
testcase_08 AC 14 ms
7,776 KB
testcase_09 AC 13 ms
7,820 KB
testcase_10 AC 13 ms
7,884 KB
testcase_11 AC 14 ms
7,976 KB
testcase_12 AC 14 ms
7,964 KB
testcase_13 AC 13 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    A, B, C, D, E = list(map(int, input().split()))
    cards = [A, B, C, D, E]
    numbers = set(cards)
    numbers_count = []
    for card in cards:
        numbers_count.append(cards.count(card))
    # numbers_count = list(map(lambda x: cards.count(x), cards))
    
    if len(numbers) == 2:
        # FULL HOUSE
        if cards.count(A) == 2 or cards.count(A) == 3:
            print("FULL HOUSE")
        # Not FULL HOUSE -> NO PAIR
        else:
            print("NO HAND")
        
    elif len(numbers) == 3:
        # THREE CARD
        if max(numbers_count) == 3:
            print("THREE CARD")
        else:
            print("TWO PAIR")
        # TWO PAIR
    elif len(numbers) == 4:
        print("ONE PAIR")
    else:
        print("NO HAND")


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