結果

問題 No.227 簡単ポーカー
ユーザー bellangeldindonbellangeldindon
提出日時 2017-06-03 18:17:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 566 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 7,092 KB
実行使用メモリ 6,428 KB
最終ジャッジ日時 2023-10-22 03:06:46
合計ジャッジ時間 983 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def poker(card):
	tmp = -1
	hand = []
	cnt = 1
	for i in range(0, 5):
		if card[i] == tmp:
			cnt += 1
		else:
			if tmp != -1:
				hand.append(cnt)
				cnt = 1
			tmp = card[i]
	if cnt != 1:
		hand.append(cnt)
		
	pair = 0
	three = 0
	for i in range(0, len(hand)):
		if hand[i] == 2:
			pair += 1
		if hand[i] == 3:
			three += 1
	if pair == 2:
		return 'TWO PAIR'
	if pair == 1:
		if three == 1:
			return 'FULL HOUSE'
		return 'ONE PAIR'
	if three == 1:
		return 'THREE CARD'
	return 'NO HAND'

card = map(int, raw_input().split())
card.sort()

print poker(card)
0