結果

問題 No.227 簡単ポーカー
ユーザー くまちゃんくまちゃん
提出日時 2022-02-07 12:52:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 667 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 9,880 KB
最終ジャッジ日時 2023-09-02 22:59:28
合計ジャッジ時間 1,548 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
9,680 KB
testcase_01 AC 32 ms
9,700 KB
testcase_02 AC 32 ms
9,708 KB
testcase_03 AC 33 ms
9,704 KB
testcase_04 AC 33 ms
9,792 KB
testcase_05 AC 33 ms
9,768 KB
testcase_06 AC 33 ms
9,776 KB
testcase_07 AC 33 ms
9,768 KB
testcase_08 AC 33 ms
9,792 KB
testcase_09 AC 34 ms
9,792 KB
testcase_10 AC 32 ms
9,784 KB
testcase_11 AC 31 ms
9,760 KB
testcase_12 AC 32 ms
9,700 KB
testcase_13 AC 32 ms
9,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
from typing import Counter


def main():
    a, b, c, d, e = (int(x) for x in input().split())
    l = [a, b, c, d, e]
    counter = collections.Counter(l)
    if len(counter) == 1:
        print('NO HAND')
        exit()
    
    k = counter.most_common()[0][1]
    m = counter.most_common()[1][1]
    s = len(counter)

    if k == 3 and m == 2: 
        print('FULL HOUSE')
    elif k == 3 and m == 1 and s == 3:
        print('THREE CARD')
    elif k == 2 and m == 2 and s == 3:
        print('TWO PAIR')
    elif k == 2 and m == 1 and s == 4:
        print('ONE PAIR')
    else:
        print('NO HAND')


if __name__ == '__main__':
    main()
0