結果

問題 No.227 簡単ポーカー
ユーザー polygon283polygon283
提出日時 2023-09-05 06:46:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-09-05 06:46:20
合計ジャッジ時間 1,803 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 16 ms
7,928 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,832 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,756 KB
testcase_10 AC 16 ms
7,784 KB
testcase_11 AC 15 ms
7,788 KB
testcase_12 AC 16 ms
7,760 KB
testcase_13 AC 16 ms
7,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def count_cards(cards):
    card_count = {}
    
    for card in cards:
        if card in card_count:
            card_count[card] += 1
        else:
            card_count[card] =1
    return card_count

def check_cards(cards):
    card_count = count_cards(cards)
    counts = list(card_count.values())
    
    if counts.count(3) == 1 and counts.count(2) == 1:
        return "FULL HOUSE"
    if counts.count(3) == 1:
        return "THREE CARD"
    if counts.count(2) == 2:
        return "TWO PAIR"
    if counts.count(2) == 1:
        return "ONE PAIR"
    
    return "NO PAIR"



        

input_card = input()
split_card = input_card.split()
cards = []
for card in split_card:
    cards.append(int(card))
result = check_cards(cards)
print(result)
0