結果

問題 No.227 簡単ポーカー
ユーザー 坂口弘次郎坂口弘次郎
提出日時 2022-06-06 21:01:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 9,824 KB
最終ジャッジ日時 2023-10-21 03:40:37
合計ジャッジ時間 1,285 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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