Problem:


ポーカー

ポーカーの手札データを読み込んで、それぞれについてその役を出力するプログラムを作成してください。ただし、この問題では、以下のルールに従います。

ポーカーはトランプ 5 枚で行う競技です。

同じ数字のカードは 5 枚以上ありません。

ジョーカーは無いものとします。

以下のポーカーの役だけを考えるものとします。(番号が大きいほど役が高くなります。)

役なし(以下に挙げるどれにも当てはまらない)

ワンペア（2 枚の同じ数字のカードが1 組ある）

ツーペア（2 枚の同じ数字のカードが2 組ある）

スリーカード（3 枚の同じ数字のカードが1 組ある）

ストレート（5 枚のカードの数字が連続している）

ただし、A を含むストレートの場合、A で終わる並びもストレートとします。つまり、A を含むストレート
は、A 2 3 4 5 　と　10 J Q K A 　の２種類です。J Q K A 2 などのように、A をまたぐ並び
はストレートではありません。（この場合、「役なし」になります）。

フルハウス（3 枚の同じ数字のカードが1 組と、残りの2 枚が同じ数字のカード）

フォーカード（4 枚の同じ数字のカードが1 組ある）

Input

入力は複数のデータセットからなります。各データセットは以下の形式で与えられます。

手札1,手札2,手札3,手札4,手札5

手札は、トランプのJ(ジャック) を11、Q(クイーン) を12、K(キング) を13、A（エース）を 1、その他はそれぞれの数字で表すこととします。

データセットの数は 50 を超えません。

Output

データセットごとに、手札によってできる最も高い役をひとつ出力してください。役の表記については出力例に従ってください。

Sample Input

1,2,3,4,1
2,3,2,3,12
12,13,11,12,12
7,6,7,6,7
3,3,2,3,3
6,7,8,9,10
11,12,10,1,13
11,12,13,1,2

Output for the Sample Input

one pair
two pair
three card
full house
four card
straight
straight
null

3 3 2 3 3 という手札であったときは、two pair ではなく four card です。



Sample input:
1,2,3,4,1
2,3,2,3,12
12,13,11,12,12
7,6,7,6,7
3,3,2,3,3
6,7,8,9,10
11,12,10,1,13
11,12,13,1,2


Sample output:
one pair
two pair
three card
full house
four card
straight
straight
null

Submission status: Wrong Answer

Solution code:
def poker(a,b,c,d,e):
    x = [a,b,c,d,e]
    x.sort()
    if x[1]==x[4] or x[0]==x[3]:
        print "fourcard"
    elif x[0]==x[2] and x[3]==x[4]:
        print "fullhouse"
    elif x[0]==x[1] and x[2]==x[4]:
        print "fullhouse"
    elif x[0]==x[2] or x[2]==x[4]:
        print "threecard"
    elif x[0]==x[1] and x[2]==x[3]:
        print "twopair"
    elif x[1]==x[2] and x[3]==x[4]:
        print "twopair"
    elif x[0]==x[1] and x[3]==x[4]:
        print "twopair"
    elif x[0]==x[1] or x[1]==x[2] or x[2]==x[3] or x[3]==x[4]:
        print "onepair"
    elif x[0]==x[1]-1==x[2]-2==x[3]-3==x[4]-4 or x[0]==x[1]-9==x[2]-10==x[3]-11==x[4]-12:
        print "straight"
    else :
        print "none"

Submission status: Wrong Answer

Solution code:
def yaku(card):
    table=[0]*13
    for i in range(5):
        table[card[i]-1]+=1
    if table.count(4)!=0:
        return "four card"
    elif table.count(3)!=0:
        if table.count(2)!=0:
            return "full house"
        else:
            return "three card"
    elif table.count(2)!=0:
        if table.count(2)==2:
            return "two pair"
        else:
            return "one pair"
    else:

        if ",".join(map(str,card)) in ("1,2,3,4,5,6,7,8,9,10,11,12,13" or "1,10,11,12,13"):
            return "straight"
        else:
            return "null"
while True:
    try:
        card=map(int,raw_input().split(","))
        card.sort()
        print yaku(card)
    except:
        break

Submission status: Wrong Answer

Solution code:
def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

while True:
    try:
        card_lis = [int(char) for char in raw_input().split(',')]
        heaven()
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
import sys

def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'
                
for line in sys.stdin.readlines():
    card_lis = [int(char) for char in line.split(',')]
    heaven()

Submission status: Wrong Answer

Solution code:
def heaven(card_lis):
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic, card_lis)
    
def suicide(result_dic, card_lis):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

card_lis_lis = []               
while True:
    try:
        card_lis_lis.append([int(char) for char in raw_input().split(',')])
    except EOFError:
        for card_lis in card_lis_lis:
            heaven(card_lis)
        break

Submission status: Wrong Answer

Solution code:
def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

card_lis_lis = []               
while True:
    try:
        card_lis = [int(char) for char in raw_input().split(',')]
        heaven()
    except:
        break

Submission status: Wrong Answer

Solution code:
import sys

def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

for input_line in sys.stdin:
    card_lis = [int(char) for char in input_line.split(',')]
    heaven()

Submission status: Wrong Answer

Solution code:
import sys

def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1] or card_lis == [1,2,3,4,5] or card_lis == [11,12,10,1,13]:
            print 'straight'
        else:
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

for input_line in sys.stdin:
    card_lis = [int(char) for char in input_line.split(',')]
    heaven()

Submission status: Wrong Answer

Solution code:
import sys

def heaven():
    result_dic = {}
    check_num_lis = []
    for i in range(5):
        check_num = card_lis[0]
        if not check_num in check_num_lis:
            for card in card_lis[1:]:
                if card == check_num:
                    if not card in result_dic:
                        result_dic[card] = 2
                    else:
                        result_dic[card] = result_dic[card] + 1
            check_num_lis.append(check_num)
        card_lis.append(check_num)
        del card_lis[0]
    
    suicide(result_dic)
    
def suicide(result_dic):
    result = result_dic.values()
    result.sort()
    if result == [2]:
        print 'one pair'
    elif result == [2,2]:
        print 'two pair'
    elif result == [3]:
        print 'three card'
    elif result == [4]:
        print 'four card'
    elif result == [2,3]:
        print 'full house'
    elif not result:
        if card_lis == [10,11,12,13,1]:
            print 'straight'
        else:
            card_lis.sort()
            check_num = card_lis[0]
            for card in card_lis:
                if card == check_num:
                    check_num = card + 1
                else:
                    print 'null'
                    break
            else:
                print 'straight'

for input_line in sys.stdin:
    card_lis = [int(char) for char in input_line.split(',')]
    heaven()

Submission status: Wrong Answer

Solution code:
import sys

def is_onepair(x):
    for i in range(4):
        if x.count(x[i]) == 2:
            return True

    return False

def is_twopair(x):
    count = 0
    for e in x:
        for e2 in x:
            if e == e2:
                count += 1
            if count == 2:
                return True

    return False

def is_threecard(x):
    for i in range(3):
        if x.count(x[i]) == 3:
            return True

    return False

def is_straight(x):
    x.sort()
    if x[0] == 1 and x[1:] == [10, 11, 12, 13]:
        return True
    for i in range(4):
        if x[i]+1 != x[i+1]:
            return False
    
    return True

def is_fullhouse(x):
    if is_threecard(x) and is_onepair(x):
        return True

    return False
    
def is_fourcard(x):
    for i in range(2):
        if x.count(x[i]) == 4:
            return True

    return False

for line in sys.stdin.readlines():
    hand = list(map(int, line.split(',')))
    if is_fourcard(hand):
        print("four card")
    elif is_fullhouse(hand):
        print("full house")
    elif is_straight(hand):
        print("straight")
    elif is_threecard(hand):
        print("three card")
    elif is_twopair(hand):
        print("two pair")
    elif is_onepair(hand):
        print("one pair")
    else:
        print("null")

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        l=map(int,raw_input().split(','))
        l.sort()
        if l.count(l[0])==4 or l.count(l[4])==4:
            print 'four card'
        elif (l.count(l[0])==2 and l.count(l[4])==3) or (l.count(l[0])==3 and l.count(l[4])==2):
            print 'full house'
        elif l[0]==(l[1]-1)==(l[2]-2)==(l[3]-3)==(l[4]-4):
            print 'straight'
        elif l.count(l[0])==3 or l.count(l[4])==3:
            print 'three card'
        elif l.count(l[1])==2 and l.count(l[3])==2:
            print 'two pair'
        elif len(set(l)):
            print 'one pair'
        else:
            print 'null'
    except:
        break

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        l=map(int,raw_input().split(','))
        l.sort()
        if l.count(l[0])==4 or l.count(l[4])==4:
            print 'four card'
        elif (l.count(l[0])==2 and l.count(l[4])==3) or (l.count(l[0])==3 and l.count(l[4])==2):
            print 'full house'
        elif l[0]==(l[1]-1)==(l[2]-2)==(l[3]-3)==(l[4]-4):
            print 'straight'
        elif l.count(l[0])==3 or l.count(l[4])==3:
            print 'three card'
        elif l.count(l[1])==2 and l.count(l[3])==2:
            print 'two pair'
        elif len(set(l))==4:
            print 'one pair'
        else:
            print 'null'
    except:
        break

Submission status: Wrong Answer

Solution code:
while 1:
    try:
        l=map(int,raw_input().split(','))
        l.sort()
        if l.count(l[0])==4 or l.count(l[4])==4:
            print 'four card'
        elif (l.count(l[0])==2 and l.count(l[4])==3) or (l.count(l[0])==3 and l.count(l[4])==2):
            print 'full house'
        elif l[0]==(l[1]-1)==(l[2]-2)==(l[3]-3)==(l[4]-4):
            print 'straight'
        elif l.count(l[2])==3:
            print 'three card'
        elif l.count(l[1])==2 and l.count(l[3])==2:
            print 'two pair'
        elif len(set(l))==4:
            print 'one pair'
        else:
            print 'null'
    except:
        break

Submission status: Wrong Answer

Solution code:
def function(a,b,c,d,e):
	A=[a,b,c,d,e]
	A.sort()
	#4card
	if A[0]==A[1]==A[2]==A[3] or A[1]==A[2]==A[3]==A[4]:
		print("four card")
	#Full house
	elif (A[0]==A[1] and A[2]==A[3]==A[4]) or (A[0]==A[1]==A[2] and A[3]==A[4]):
		print("full house")
	#straight A?????????
	elif A[0]==1 and A[1]==10 and A[2]==11 and A[3]==12 and A[4]==13:
		print("straight")
	#straight A???????????????
	elif A[0]==A[1]-1==A[2]-2==A[3]-3==A[4]-4:
		print("straight")
	#threee
	elif A[0]==A[1]==A[2] or A[1]==A[2]==A[3] or A[2]==A[3]==A[4]:
		print("threee card")
	elif (A[0]==A[1] and A[2]==A[3]) or (A[1]==A[2] and A[3]==A[4]):
		print("two pair")
	elif A[0]==A[1] or A[1]==A[2] or A[2]==A[3] or A[3]==A[4]:
		print("one pair")
	else:
		print("null")

while True:
	try:
		a,b,c,d,e=map(float,input().split(','))
		function(a,b,c,d,e)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
def function(a,b,c,d,e):
	A=[a,b,c,d,e]
	A.sort()
	#4card
	if A[0]==A[1]==A[2]==A[3] or A[1]==A[2]==A[3]==A[4]:
		print("four card")
	#Full house
	elif (A[0]==A[1] and A[2]==A[3]==A[4]) or (A[0]==A[1]==A[2] and A[3]==A[4]):
		print("full house")
	#straight A?????????
	elif A[0]==1 and A[1]==10 and A[2]==11 and A[3]==12 and A[4]==13:
		print("straight")
	#straight A???????????????
	elif A[0]==A[1]-1==A[2]-2==A[3]-3==A[4]-4:
		print("straight")
	#threee
	elif A[0]==A[1]==A[2] or A[1]==A[2]==A[3] or A[2]==A[3]==A[4]:
		print("three card")
	elif (A[0]==A[1] and A[2]==A[3]) or (A[1]==A[2] and A[3]==A[4]):
		print("two pair")
	elif A[0]==A[1] or A[1]==A[2] or A[2]==A[3] or A[3]==A[4]:
		print("one pair")
	else:
		print("null")

while True:
	try:
		a,b,c,d,e=map(float,input().split(','))
		function(a,b,c,d,e)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
def function(a,b,c,d,e):
	A=[a,b,c,d,e]
	A.sort()
	#4card
	if A[0]==A[1]==A[2]==A[3] or A[1]==A[2]==A[3]==A[4]:
		print("four card")
	#Full house
	elif (A[0]==A[1] and A[2]==A[3]==A[4]) or (A[0]==A[1]==A[2] and A[3]==A[4]):
		print("full house")
	#straight A?????????
	elif A[0]==1 and A[1]==10 and A[2]==11 and A[3]==12 and A[4]==13:
		print("straight")
	#straight A???????????????
	elif A[0]==A[1]-1==A[2]-2==A[3]-3==A[4]-4:
		print("straight")
	#threee
	elif A[0]==A[1]==A[2] or A[1]==A[2]==A[3] or A[2]==A[3]==A[4]:
		print("three card")
	elif (A[0]==A[1] and A[2]==A[3]) or (A[1]==A[2] and A[3]==A[4]):
		print("two pair")
	elif A[0]==A[1] or A[1]==A[2] or A[2]==A[3] or A[3]==A[4]:
		print("one pair")
	else:
		print("null")

while True:
	try:
		a,b,c,d,e=map(int,input().split(','))
		function(a,b,c,d,e)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
def function(a,b,c,d,e):
	A=[a,b,c,d,e]
	A.sort()
	#4card
	if A[0]==A[3] or A[1]==A[4]:
		print("four card")
	#Full house
	elif (A[0]==A[1] and A[2]==A[4]) or (A[0]==A[2] and A[3]==A[4]):
		print("full house")
	#three card
	elif A[0]==A[2] or A[1]==A[3] or A[2]==A[4]:
		print("three card")
	elif (A[0]==A[1] and A[2]==A[3]) or (A[1]==A[2] and A[3]==A[4]):
		print("two pair")
	elif A[0]==A[1] or A[1]==A[2] or A[2]==A[3] or A[3]==A[4]:
		print("one pair")
	#straight A?????????
	elif A==[1,10,11,12,13]:
		print("straight")
	#straight A???????????????
	elif A[0]==A[1]-1==A[2]-2==A[3]-3==A[4]-4:
		print("straight")
	else:
		print("null")

while True:
	try:
		a,b,c,d,e=map(int,input().split(','))
		function(a,b,c,d,e)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
def function(a,b,c,d,e):
	A=[a,b,c,d,e]
	A.sort()
	print(A)
	#4card
	if A[0]==A[3] or A[1]==A[4]:
		print("four card")
	#Full house
	elif (A[0]==A[1] and A[2]==A[4]) or (A[0]==A[2] and A[3]==A[4]):
		print("full house")
	#three card
	elif A[0]==A[2] or A[1]==A[3] or A[2]==A[4]:
		print("three card")
	elif (A[0]==A[1] and A[2]==A[3]) or (A[0]==A[1] and A[3]==A[4]) or (A[1]==A[2] and A[3]==A[4]):
		print("two pair")
	elif A[0]==A[1] or A[1]==A[2] or A[2]==A[3] or A[3]==A[4]:
		print("one pair")
	#straight A?????????
	elif A==[1,10,11,12,13]:
		print("straight")
	#straight A???????????????
	elif A[0]==A[1]-1==A[2]-2==A[3]-3==A[4]-4:
		print("straight")
	else:
		print("null")

while True:
	try:
		a,b,c,d,e=map(int,input().split(','))
		function(a,b,c,d,e)
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
#encoding=utf-8

import sys
tako = [1,2,3,4,5,6,7,8,9,10,11,12,13,1]
for line in sys.stdin:
    count1, count2, count3, flag = 0, 0, [], 0
    line = line[:-1]
    num = map(int, line.split(","))
    for i in xrange(4):
        for j in xrange(i + 1,5):
            if num[i] == num[j] and num[j] != 0:
                count1 += 1
                num[j] = 0
        count3.append(count1)
        count1 = 0

    if sum(count3) == 1:
        print "one pair"
    elif count3.count(1) == 2:
        print "two pair"
    elif count3.count(1) != count3.count(2):
        print "three card"
    elif count3.count(1) == count3.count(2) == 1:
        print "hull house"
    elif count3.count(3) == 1:
        print "four card"
    elif sum(count3) == 0:
        for i in xrange(13):
            if sorted(tako[i:i+5]) == sorted(num):
                print "straigth"
                flag = 1
                break 
        if flag != 1:
            print "null"
            flag = 0

Submission status: Wrong Answer

Solution code:
#encoding=utf-8

import sys

def inp():
    word = []
    for line in sys.stdin:
        word = map(int, line.split(","))
        syori(sorted(word))

def syori(word):
    flag = [0,0]
    if sum(word[1:5]) == 46:
        word.append(int(word[0]))
        del word[0]

    if word == [10,11,12,13,1]:
        print "straight"
        
    else:
        for j in xrange(1,14):
            if word.count(j) == 2:
                flag[0] += 1
            elif word.count(j) == 3:
                flag[1] += 1
            elif word.count(j) == 4:
                print "four card"
                flag = [10,10]
                break
            elif word[0] + 2 == word[1] + 1 == word[2] == word[3] - 1 == word[4] - 2:
                print "straight"
                flag = [10,10]
                break

        if flag[0] == flag[1] == 1:
            print "full house"
        elif flag[0] == 1:
            print "one pair"
        elif flag[0] == 2:
            print "two pair"
        elif flag[1] == 1:
            print "three pair"
        elif flag[0] < 1 or flag[1] < 1:
            print "null"

if __name__ == "__main__":
    inp()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

poker = ["0", "null", "one pair", "two pair", "three card", "straight", "full house", "four card"]
for line in sys.stdin:
    H = map(int, line.split(','))
    H.sort()
    if H[0] == H[1] == H[2] == H[3] or H[1] == H[2] == H[3] == H[4]:
        print poker[7]
    elif H[0] == H[1] or H[1] == H[2] or H[2] == H[3] or H[3] == H[4]:
        if H[0] == H[1] == H[2] or H[1] == H[2] == H[3] or H[2] == H[3] == H[4]:
            if H[0] == H[1] and H[2] == H[3] == H[4] or H[0] == H[1] == H[2] and H[3] == H[4]:
                print poker[6]
            else:
                print poker[4]
        else:
            if H[0] == H[1] and H[2] == H[3] or H[0] == H[1] and H[3] == H[4] or H[1] == H[2] and H[3] == H[4]:
                print poker[3]
            else:
                print poker[2]
    else:
        if H[0] == 1:
            H[0] += 13
            H.sort()
        if H[0]+1 == H[1] and H[1]+1 == H[2] and H[2]+1 == H[3] and H[3]+1 == H[4]:
            print poker[5]
        else:
            print poker[1]

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def is_four_card(d):
    return 4 in d.values()


def is_full_house(d):
    return 3 in d.values() and 2 in d.values()


def is_straight(d):
    flag = [False, 0]
    for i in d.values():
        if flag[0] == True and flag[1] == 5:
            return True

        if i == 1:
            flag[0] = True
            flag[1] += 1
    return False


def is_three_card(d):
    return 3 in d.values()


def is_two_pair(d):
    return list(d.values()).count(2) == 2


def is_one_pair(d):
    return list(d.values()).count(2) == 1


def judge(d):
    if is_four_card(d):
        print('four card')
    elif is_full_house(d):
        print('full house')
    elif is_straight(d):
        print('straight')
    elif is_three_card(d):
        print('three card')
    elif is_two_pair(d):
        print('two pair')
    elif is_one_pair(d):
        print('one pair')
    else:
        print('null')


def solve(cards):
    d = {k: 0 for k in range(1, 14)}
    for card in cards:
        d[card] += 1
    judge(d)

_input = [int(e) for e in input().split(",")]
solve(_input)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def is_four_card(d):
    return 4 in d.values()


def is_full_house(d):
    return 3 in d.values() and 2 in d.values()


def is_straight(d):
    flag = False
    times = 0
    for i in d.values():
        if flag and times == 5:
            return True
        elif flag and times == 4:
            _values = list(d.values())
            return _values[0] == 1 and _values[1] == 0

        if i == 1:
            flag = True
            times += 1
    return False


def is_three_card(d):
    return 3 in d.values()


def is_two_pair(d):
    return list(d.values()).count(2) == 2


def is_one_pair(d):
    return list(d.values()).count(2) == 1


def judge(d):
    if is_four_card(d):
        print('four card')
    elif is_full_house(d):
        print('full house')
    elif is_straight(d):
        print('straight')
    elif is_three_card(d):
        print('three card')
    elif is_two_pair(d):
        print('two pair')
    elif is_one_pair(d):
        print('one pair')
    else:
        print('null')


def solve(cards):
    d = {k: 0 for k in range(1, 14)}
    for card in cards:
        d[card] += 1
    judge(d)

# _input = '11,12,13,1,2'
_input = input()
_cards = [int(e) for e in _input.split(",")]
solve(_cards)

Submission status: Wrong Answer

Solution code:
from collections import Counter

def is_strait(_cnt):
    f = 0
    for i in range(1, 14):
        if _cnt[(i % 13) + 1] == 1:
            f += 1
            if f == 5:
                return True
        elif f > 0 or _cnt[(i % 13) + 1] > 1:
            return False
    return False

try:
    while 1:
        cnt = Counter(map(int,input().split(',')))
        mc = cnt.most_common(2)
        if mc[0][1] == 4:
            print('four card')
        elif mc[0][1] == 3 and mc[1][1] == 2:
            print('full house')
        elif mc[0][1] == 3:
            print('three card')
        elif mc[0][1] == mc[1][1] == 2:
            print('two pair')
        elif mc[0][1] == 2:
            print('one pair')
        elif is_strait(cnt):
            print('straight')
        else:
            print('null')
except:
    pass

Submission status: Wrong Answer

Solution code:
from collections import Counter

def is_strait(_cnt):
    f = 0
    for i in range(1, 14):
        if _cnt[(i % 13) + 1] == 1:
            f += 1
            if f == 5:
                return True
        elif f > 0 or _cnt[(i % 13) + 1] > 1:
            return False
    return False

try:
    while 1:
        cnt = Counter(map(int,input().split(',')))
        mc = cnt.most_common(2)
        if mc[0][1] >= 4:
            print('four card')
        elif mc[0][1] == 3 and mc[1][1] == 2:
            print('full house')
        elif mc[0][1] == 3:
            print('three card')
        elif mc[0][1] == mc[1][1] == 2:
            print('two pair')
        elif mc[0][1] == 2:
            print('one pair')
        elif is_strait(cnt):
            print('straight')
        else:
            print('null')
except:
    pass

Submission status: Wrong Answer

Solution code:
import fileinput
from collections import Counter

for line in fileinput.input():
    if line == "\n":
        break
    else:
        card = [c for c in line.rstrip().split(",")]
        card_num = [int(c) for c in line.rstrip().split(",")]
        card_sort = sorted(card_num)
        counter = Counter(card)
        card_type = counter.most_common()
        if card_type[0][1] == 4:
            print("four card")
        elif card_type[0][1] == 3:
            if card_type[1][1] == 2:
                print("full house")
            else:
                print("three card")
        elif card_type[0][1] == 2:
            if card_type[1][1] == 2:
                print("two pair")
            else:
                print("one pair")
        elif card_sort == [1, 10, 11, 12, 13]:
            print("straight")
        else:
            for i in range(1, 5):
                if card_sort[0] + i == card_sort[i]:
                    f = "ok"
                else:
                    f = "no"
                    break
            if f == "ok":
                print("straight")
            else:
                print("nule")

Submission status: Wrong Answer

Solution code:
from itertools import permutations

def inini(_card):
    for i in range(len(_card)):
        _card[i] = 0


def main():
    while True:
        try:
            card = 14*[0]
            inini(card)
            number = list(map(int,input().split(',')))
            for v in number:
                card[v] += 1
            one_pair = 0
            tree_card = 0
            four_card = 0
            flag = 0
            for value in sorted(set(number),key=number.index):
                if card[value] == 2:
                    one_pair += 1
                elif card[value] == 3:
                    tree_card += 1
                elif card[value] == 4:
                    four_card += 1
            if one_pair == 1 and tree_card ==1:
                print('full house')
                flag = 777        
            elif one_pair == 1:
                print('one pair')
                flag = 777
            elif one_pair == 2:
                print('two pair')
                flag = 777
            elif tree_card == 1:
                print('tree card')
                flag = 777
            elif four_card == 1:
                print('four card')
                flag = 777
            straight = [[1,2,3,4,5],[2,3,4,5,6],[3,4,5,6,7],[4,5,6,7,8],[5,6,7,8,9],[6,7,8,9,10],[7,8,9,10,11],[8,9,10,11,12],[9,10,11,12,13],[10,11,12,13,1]]
            for s_list in straight:
                number.sort()
                if number[0] == 1 and number[4] == 13:
                    number.append(1)
                    number.pop(0)
                if number == s_list:
                    print('straight')
                    flag = 777
                    break
            if flag == 0:
                print('null')
        except EOFError:
            break

  

       
if __name__ == '__main__':
    main()