結果

問題 No.227 簡単ポーカー
ユーザー rpy3cpprpy3cpp
提出日時 2015-06-19 22:46:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 561 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,652 KB
最終ジャッジ日時 2023-09-21 10:01:25
合計ジャッジ時間 954 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,644 KB
testcase_01 AC 17 ms
8,652 KB
testcase_02 AC 16 ms
8,480 KB
testcase_03 AC 17 ms
8,476 KB
testcase_04 AC 17 ms
8,640 KB
testcase_05 AC 16 ms
8,512 KB
testcase_06 AC 16 ms
8,496 KB
testcase_07 AC 16 ms
8,480 KB
testcase_08 AC 17 ms
8,476 KB
testcase_09 AC 17 ms
8,544 KB
testcase_10 AC 17 ms
8,580 KB
testcase_11 AC 16 ms
8,464 KB
testcase_12 AC 17 ms
8,584 KB
testcase_13 AC 17 ms
8,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

a = list(map(int, input().split()))
count = list(collections.Counter(a).values())
count.sort()

def is_full_house(count):
    return count == [2, 3]

def is_three_card(count):
    return count == [1, 1, 3]

def is_two_pair(count):
    return count == [1, 2, 2]

def is_one_pair(count):
    return count == [1, 1, 1, 2]

if is_full_house(count):
    print('FULL HOUSE')
elif is_three_card(count):
    print('THREE CARD')
elif is_two_pair(count):
    print('TWO PAIR')
elif is_one_pair(count):
    print('ONE PAIR')
else:
    print('NO HAND')
0