結果

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

ソースコード

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"
    else:
        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