結果

問題 No.227 簡単ポーカー
ユーザー ackyacky
提出日時 2024-02-01 15:02:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,066 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-02-01 15:02:25
合計ジャッジ時間 1,343 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 29 ms
10,112 KB
testcase_02 AC 31 ms
10,112 KB
testcase_03 AC 31 ms
10,112 KB
testcase_04 AC 29 ms
10,112 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 29 ms
10,112 KB
testcase_08 WA -
testcase_09 AC 28 ms
10,112 KB
testcase_10 AC 31 ms
10,112 KB
testcase_11 AC 28 ms
10,112 KB
testcase_12 AC 29 ms
10,112 KB
testcase_13 AC 29 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main() -> None:

    # 整数の組み合わせを入力し、リストに入れる
    card_list = list(map(int, input().split()))

    # 自分を含めて、同じ整数の個数をそれぞれ数える
    count = []

    for i in range(5):
        count_card = 0
        for j in range(5):
            if card_list[i] == card_list[j]:
                count_card += 1
        count.append(count_card)

    # ペアがない整数とペアがあった整数を数える
    number_of_one = 0
    number_of_two = 0

    for i in count:
        if i == 1:
            number_of_one += 1
        elif i == 2:
            number_of_two += 1

    # ペアの個数を元に役を判定する
    if number_of_one == 0 and number_of_two >= 1:
        print('FULL HOUSE')

    elif number_of_one == 0 and number_of_two == 0:
        print('NO PAIR')

    elif number_of_one == 1:
        print('TWO PAIR')

    elif number_of_one == 2:
        print('THREE CARD')

    elif number_of_one == 3:
        print('ONE PAIR')

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