結果

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

ソースコード

diff #

import collections

def card_input():
    txt = input()
    cards = list(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