結果

問題 No.227 簡単ポーカー
ユーザー 坂口弘次郎
提出日時 2022-06-06 21:01:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-21 04:43:20
合計ジャッジ時間 1,324 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

def card_input():
    txt = "1 2 5 5 5"
    cards = txt.split()
    return cards

def judge(cards):
    c = collections.Counter(cards)
    values, counts = zip(*c.most_common())
    result = "NO HAND"
    if counts[0] == 3 and counts[1] == 2:
        result = "FULL HOUSE"
    elif counts[0] == 3 and counts[1] != 2:
        result = "THREE CARD"
    elif counts[0] == 2 and counts[1] == 2:
        result = "TWO PAIR"
    elif counts[0] == 2 and counts[1] != 2:
        result = "ONE PAIR"
    return result

print(judge(card_input()))
0