Problem:


Card Game

  Taro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card.
  The name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner obtains 3 points. In the case of a draw, they obtain 1 point each.

  Write a program which reads a sequence of cards Taro and Hanako have and reports the final scores of the game.

Input

  In the first line, the number of cards n is given. In the following n lines, the cards for n turns are given respectively. For each line, the first string represents the Taro's card and the second one represents Hanako's card.

Constraints

n ≤ 1000

The length of the string ≤ 100

Output

  Print the final scores of Taro and Hanako respectively. Put a single space character between them.

Sample Input

3
cat dog
fish fish
lion tiger

Sample Output

1 7



Sample input:
3
cat dog
fish fish
lion tiger


Sample output:
1 7

Submission status: Wrong Answer

Solution code:
def main():

    TaroScore = HanaScore = 0
    n = int(input())
    for _ in range(n):
        [Taro, Hana] = list(input().lower().split())

        lenT = len(Taro)
        lenH = len(Hana)
        lenMin = min(lenT, lenH)

        if Taro == Hana:
            TaroScore += 1
            HanaScore += 1
        else:
            for i in range(lenMin):
                if ord(Taro[i]) > ord(Hana[i]):
                    TaroScore += 3
                    break
                elif ord(Taro[i]) < ord(Hana[i]):
                    HanaScore += 3
                    break
                else:
                    pass


    print(TaroScore, HanaScore)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
turn = int(input())

taro_score = 0
hanako_score = 0 

for i in range(turn):
    tcard,hcard = input().split()
    tcard = str(tcard)
    hcard = str(hcard)
    taro_card = [0]*len(tcard)
    hanako_card = [0]*len(hcard)
    
    
    for j in range(len(tcard)):
        taro_card[j] = ord(tcard[j])
    
    
    for k in range(len(hcard)):
        hanako_card[k] = ord(hcard[k])
        
    if len(tcard) == len(hcard):
    
        for l in range(len(tcard)):
            if taro_card[l] > hanako_card[l]:
                taro_score += 3
                break
            
            elif taro_card[l] < hanako_card[l]:
                hanako_score += 3
                break   
            
            else:
                if l == len(tcard)-1:
                    taro_score += 1
                    hanako_score += 1
                else:
                    continue
    
    elif len(tcard) < len(hcard):
        
        for a in range(len(tcard)):
            if taro_card[a] > hanako_card[a]:
                taro_score += 3
                break
            
            elif taro_card[a] < hanako_card[a]:
                hanako_score += 3
                break
                
            else:
                if a == len(tcard)-1:
                    taro_score += 3
                    
                else:
                    continue
                    
    else:
            
        for b in range(len(hcard)):
            if taro_card[b] > hanako_card[b]:
                taro_score += 3
                break

            elif taro_card[b] < hanako_card[b]:
                hanako_score += 3
                break

            else:
                if b == len(hcard)-1:
                    hanako_score += 3

                else:
                    continue
                    
                    
print("%d %d"%(taro_score,hanako_score))

Submission status: Wrong Answer

Solution code:
num = int(input())
taro, hanako = 0 ,0
for i in range(num):
    lst = list(map(str, input().split()))
    while 1:
        if lst[0] == lst[1]:
            taro = taro + 1
            hanako = hanako + 1
            break
        else:
            length = min(len(lst[0]),len(lst[1]))
            for j in range(length):
                first = ord(lst[0][j:j+1])
                second = ord(lst[1][j:j+1])
                if first > second:
                    taro = taro + 3
                    break
                elif first < second:
                    hanako = hanako + 3
                    break
                elif j == length - 1:
                    if len(lst[0]) > len(lst[1]):
                        second = second +3
                    elif len(lst[0]) < len(lst[1]):
                        first = first +3
            break
print(str(taro) + " " + str(hanako))

Submission status: Wrong Answer

Solution code:
num = int(input())
taro, hanako = 0 ,0
for i in range(num):
    lst = list(map(str, input().split()))
    while 1:
        if lst[0] == lst[1]:
            taro = taro + 1
            hanako = hanako + 1
            break
        else:
            length = min(len(lst[0]),len(lst[1]))
            for j in range(length):
                first = ord(lst[0][j:j+1])
                second = ord(lst[1][j:j+1])
                if first > second:
                    taro = taro + 3
                    break
                elif first < second:
                    hanako = hanako + 3
                    break
                elif j == length - 1:
                    if len(lst[0]) > len(lst[1]):
                        second = second + 3
                    elif len(lst[0]) < len(lst[1]):
                        first = first + 3
            break
print(str(taro) + " " + str(hanako))

Submission status: Wrong Answer

Solution code:
#coding: UTF-8

n = int(input())
point_t = 0
point_h = 0

for i in range(n):
    cards = input()
    taro = cards[0]
    hanako = cards[1]
    if taro > hanako:
        point_h += 3
    elif taro == hanako:
        point_t += 3
    elif taro < hanako:
        point_t += 1
        point_h += 1

print(point_t, point_h)

Submission status: Wrong Answer

Solution code:
#coding: UTF-8

n = int(input())
point_t = 0
point_h = 0

for i in range(n):
    cards = list(map(str, input().split()))
    taro = cards[0]
    hanako = cards[1]
    if taro > hanako:
        point_h += 3
    elif taro < hanako:
        point_t += 3
    else:
        point_t += 1
        point_h += 1

print(point_t, point_h)

Submission status: Wrong Answer

Solution code:
num = int(input())

t=0
h=0

for i in range(num):
	Ta,Ha = input().split(" ")
	if Ta[:1] > Ha[:1]:
		t += 3
	elif  Ta[:1] < Ha[:1]:
		h += 3
	else:
		t += 1
		h += 1
print(t,h)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())

tarou=0
hanako=0
for i in range(n):
    words=raw_input().split(" ")
    tarou_sum = 0
    hanako_sum = 0
    for c in words[0]:
        tarou_sum += ord(c)
    for c in words[1]:
        hanako_sum += ord(c)

    if tarou_sum > hanako_sum:
        tarou += 3
    if tarou_sum < hanako_sum:
        hanako += 3
    else:
        tarou += 1
        hanako += 1

print "%d %d" % (tarou, hanako)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())

tarou=0
hanako=0
for i in range(n):
    words=raw_input().split(" ")
    tarou_sum = 0
    hanako_sum = 0
    for c in words[0]:
        tarou_sum += ord(c)
    for c in words[1]:
        hanako_sum += ord(c)

    if tarou_sum > hanako_sum:
        tarou += 3
    elif tarou_sum < hanako_sum:
        hanako += 3
    else:
        tarou += 1
        hanako += 1

print "%d %d" % (tarou, hanako)

Submission status: Wrong Answer

Solution code:
n=int(raw_input())

tarou=0
hanako=0
for i in range(n):
    words=raw_input().split(" ")
    tarou_sum = 0
    hanako_sum = 0
    for idx, c in enumerate(words[0]):
        
        if len(words[1]) -1 < idx:
            tarou += 3
            print "<" +  words[0]
            break
        
        if ord(words[1][idx]) < ord(c):
            tarou += 3
            print ">" +  words[0]
            break
        elif ord(words[1][idx]) > ord(c):
            hanako += 3
            print ">" +  words[0]
            break
        else:
            continue
    else:
        if len(words[0]) < len(words[1]):
            hanako += 3
        else:
            print "=" +  words[0]
            tarou += 1
            hanako += 1

print "%d %d" % (tarou, hanako)

Submission status: Wrong Answer

Solution code:
point = [0,0]
for i in range(int(input())):
    (t,h) = [x for x in input().split()]
    if t == h:
        point[0] += 1
        point[1] += 1
    else:
        a = [t,h]
        sorted(a)
        if t == a[1]:
            point[0] += 3
        else:
            point[1] += 3
print(point[0],point[1])

Submission status: Wrong Answer

Solution code:
import string
s = string.ascii_lowercase

taro_p = 0
hana_p = 0
for i in range(input()):
    taro,hana = raw_input().split(' ')
    print s.index(taro[0])
    print s.index(hana[0])
    if s.index(taro[0]) > s.index(hana[0]):
        taro_p = taro_p + 3
        hana_p = hana_p + 0
    elif s.index(taro[0]) < s.index(hana[0]):
        taro_p = taro_p + 0
        hana_p = hana_p + 3
    else:
        taro_p = taro_p + 1
        hana_p = hana_p + 1

print taro_p,hana_p

Submission status: Wrong Answer

Solution code:
import string
s = string.ascii_lowercase

taro_p = 0
hana_p = 0
for i in range(input()):
    taro,hana = raw_input().split(' ')
    if s.index(taro[0]) > s.index(hana[0]):
        taro_p = taro_p + 3
        hana_p = hana_p + 0
    elif s.index(taro[0]) < s.index(hana[0]):
        taro_p = taro_p + 0
        hana_p = hana_p + 3
    else:
        taro_p = taro_p + 1
        hana_p = hana_p + 1

print taro_p,hana_p

Submission status: Wrong Answer

Solution code:
n = input()
taro,hanako = raw_input().split()
taro_score = 0
hanako_score = 0
if taro > hanako :
	taro_score += 3
elif taro == hanako :
	taro_score += 1
	hanako_score += 1
else :
	hanako_score += 3
print '%d %d' %(taro_score,hanako_score)

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(n):
	taro,hanako = raw_input().split()
	taro_score = 0
	hanako_score = 0
	if taro > hanako :
		taro_score += 3
	elif taro == hanako :
		taro_score += 1
		hanako_score += 1
	else :
		hanako_score += 3
	print '%d %d' %(taro_score,hanako_score)

Submission status: Wrong Answer

Solution code:
taro = 0
hanako = 0
n = int(input())
for _ in range(n):
    taro_card, hanako_card = input().split()
    if taro_card > hanako_card:
        taro += 3
    if taro_card < hanako_card:
        hanako += 3
    else:
        taro += 1
        hanako += 1
print(taro, hanako)

Submission status: Wrong Answer

Solution code:
taro = 0
hanako = 0
n = int(input())
for _ in range(n):
    taro_card, hanako_card = input().split()
    if taro_card > hanako_card:
        taro += 3
    elif taro_card < hanako_card:
        hanako += 3
    else:
        taro += 1
        hanako += 1
    print(taro, hanako)
print(taro, hanako)

Submission status: Wrong Answer

Solution code:
n = input()

taro_score = 0
hanako_score = 0
for i in range(n):
    taro_card, hanako_card = map(str, raw_input().split())
    m = min(len(taro_card), len(hanako_card))
    flag = 0
    for j in range(m):
        if taro_card[j] > hanako_card[j]:
            flag = 1
            break
        elif taro_card[j] < hanako_card[j]:
            flag = -1
            break
        
    if flag == 1:
        taro_score += 3
    elif flag == -1:
        hanako_score += 3
    else:
        taro_score += 1
        hanako_score += 1
        
print "%d %d" % (taro_score, hanako_score)

Submission status: Wrong Answer

Solution code:
n = input()

taro_score = 0
hanako_score = 0
for i in range(n):
    taro_card, hanako_card = map(str, raw_input().split())
    m = min(len(taro_card), len(hanako_card))
    flag = 0
    for j in range(m):
        if taro_card[j] > hanako_card[j]:
            flag = 1
            break
        elif taro_card[j] < hanako_card[j]:
            flag = -1
            break
        elif j == m - 1:
            if taro_card in hanako_card:
                flag = -1
            elif hanako_card in taro_card:
                flag = 1

    if flag == 1:
        taro_score += 3
    elif flag == -1:
        hanako_score += 3
    else:
        taro_score += 1
        hanako_score += 1

print "%d %d" % (taro_score, hanako_score)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


n = int(input())

scores = [0,0]

for i in range(n):
    card = input().split()
    old_card = card
    card.sort()
    if (card[0] == card[1]):
        scores[0] += 1
        scores[1] += 1
    elif(old_card[0] == card[0]):
        scores[1] += 3
    else:
        scores[0] += 3

print(scores[0], scores[1])

Submission status: Wrong Answer

Solution code:
# coding: utf-8


n = int(input())

scores = [0,0]

for i in range(n):
    card = input().split()
    first_card = card[0]
    card.sort()
    print(card)
    print(first_card)
    if (card[0] == card[1]):
        scores[0] += 1
        scores[1] += 1
    elif(first_card == card[0]):
        scores[1] += 3
    else:
        scores[0] += 3

print(scores[0], scores[1])

Submission status: Wrong Answer

Solution code:
n = int(input())
taro=0
hanako=0
for i in range(n):
	x,y=input().split()
	#print(x,y)
	if x[0]>y[0]:
		taro += 3
	elif x[0]==y[0]:
		taro +=1
		hanako +=1
	else:
		hanako +=3
print(taro,hanako)

Submission status: Wrong Answer

Solution code:
n = input()
tp = hp = 0
for i in xrange(n):
    t, h = map(str, raw_input().split())
    if   ord(t[0]) > ord(h[0]):
        tp+=3
    elif ord(t[0]) < ord(h[0]):
        hp+=3
    else:
        tp+=1
        hp+=1
print tp, hp

Submission status: Wrong Answer

Solution code:
point_a,point_b = 0,0
for i in range(int(input())):
	a,b = input().split()
	if ord(a[0]) == ord(b[0]):
		point_a += 1
		point_b += 1
	elif ord(a[0]) < ord(b[0]):
		point_b += 3
	else :
		point_a += 3
print(point_a,point_b)

Submission status: Wrong Answer

Solution code:
point_a,point_b = 0,0
for i in range(int(input())):
	k =[]
	a,b = input().split()
	k = [[i,j] for i,j in zip(a,b) if i != j]
	if k == []:
		if len(a) < len(b):
			point_b+=3
		elif len(a) > len(b):
			point_a += 3
		else:
			point_a+=1
			point_b+=1
	elif ord(k[0][0]) < ord(k[0][1]):
		point_b += 3
	else :
		point_a += 3
	print(point_a,point_b)
print(point_a,point_b)

Submission status: Wrong Answer

Solution code:
n = int(input())
taro = 0
hanako = 0
for i in range(3):
    t,h =input().split()
    if t > h:
        taro+=3
    elif t<h:
        hanako += 3
    else:
        taro += 1
        hanako += 1

print("%d %d" % (taro,hanako))

Submission status: Wrong Answer

Solution code:
n = int(input())
tarou = 0
hanako = 0
for x in range(n):
    if hanako > tarou:
        hanako += 3
    elif tarou > hanako:
        tarou += 3
    else:
        tarou += 1
        hanako += 1
print("{0} {1}".format(tarou, hanako))

Submission status: Wrong Answer

Solution code:
n = int(input())

tarou = 0
hanako = 0

for x in range(n):
    if hanako > tarou:
        hanako += 3
    elif tarou > hanako:
        tarou += 3
    else:
        tarou += 1
        hanako += 1

print("{0} {1}".format(tarou, hanako))

Submission status: Wrong Answer

Solution code:
i = int(input())
 
tarou = 0
hanako = 0

for x in range(i):
    a,b = input().split()
    if a > b:
        hanako += 3
    elif b > a:
        tarou += 3
    else:
        hanako += 1
        tarou += 1
    print("{0} {1}".format(tarou, hanako))

Submission status: Wrong Answer

Solution code:
i = int(input())
 
tarou = 0
hanako = 0

for x in range(i):
    a,b = input().split()
    if b > a:
        hanako += 3
    elif a > b:
        tarou += 3
    else:
        hanako += 1
        tarou += 1
    print("{0} {1}".format(tarou, hanako))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

point = [0, 0]
for i in range(n):
    word = map(str, raw_input().split())
    if word[0] == word[1]:
        point[0] += 1
        point[1] += 1
    elif len(word[0]) >= len(word[1]):
        for j in range(len(word[1])):
            if word[0][j] == word[1][j]:
                continue
            elif word[0][j] > word[1][j]:
                point[0] += 3
                break
            else:
                point[1] += 3
                break
    else:
        for j in range(len(word[0])):
            if word[0][j] == word[1][j]:
                continue
            elif word[0][j] > word[1][j]:
                point[0] += 3
                break
            else:
                point[1] += 3
                break
print "%d %d" % (point[0], point[1])

Submission status: Wrong Answer

Solution code:
n = int(input())
Taro = 0
Hanako = 0
for i in range(n):
    t,h = input().split()
    for j in range(min(len(t),len(h))):
        if t == h:
            Hanako += 1
            Taro += 1
            break
        if ord(t[j:j+1]) > ord(h[j:j+1]):
            Taro += 3
            break
        if ord(t[j:j+1]) < ord(h[j:j+1]):
            Hanako += 3
            break
	

print("{} {}".format(Taro,Hanako))

Submission status: Wrong Answer

Solution code:
n = int(input())
Taro = 0
Hanako = 0
for i in range(n):
    t,h = input().split()
    for j in range(min(len(t),len(h))):
        if t == h:
            Hanako += 1
            Taro += 1
            break
        if ord(t[j:j+1]) > ord(h[j:j+1]):
            Taro += 3
            break
        if ord(t[j:j+1]) < ord(h[j:j+1]):
            Hanako += 3
            break
    if len(t) > len(h):
        Taro += 3
    elif len(t) < len(h):
        Hanako += 3
	

print("{} {}".format(Taro,Hanako))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if ord(t[0]) > ord(h[0]):
  t_score += 3
 elif ord(t[0]) < ord(h[0]):
  h_score += 3
 else:
  t_score += 1
  h_score += 1

print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if ord(t[0]) > ord(h[0]):
  t_score += 3
 elif ord(t[0]) < ord(h[0]):
  h_score += 3
 elif ord(t[0]) == ord(h[0]):
  t_score += 1
  h_score += 1

print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 t = ord(t[0])
 h = ord(h[0])
 if t > h:
  t_score += 3
 elif t < h:
  h_score += 3
 elif t == h:
  t_score += 1
  h_score += 1

print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 t_head = ord(t[0])
 h_head = ord(h[0])
 if t_head > h_head:
  t_score += 3
 elif t_head < h_head:
  h_score += 3
 elif t == h:
  if len(t) >= len(h):
   for j in range(len(h)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 1
    h_score += 1

print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 t_head = ord(t[0])
 h_head = ord(h[0])
 if t_head > h_head:
  t_score += 3
 elif t_head < h_head:
  h_score += 3
 elif t == h:
  if len(t) >= len(h):
   for j in range(len(h)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 1
    h_score += 1
  elif len(t) < len(h):
    for j in range(len(h)):
     if ord(t[j]) > ord(h[j]):
      t_score += 3
      break
     elif ord(t[j]) < ord(h[j]):
      h_score += 3
      break
    else:
     t_score += 1
     h_score += 1
   

print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   t_score += 1
   h_score += 1
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 1
    h_score += 1
   
print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) < ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) > ord(h[j]):
    h_score += 3
    break
  else:
   t_score += 1
   h_score += 1
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) < ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) > ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 1
    h_score += 1
   
print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if len(t) > len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   h_score += 3
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 3
 else:
  for j in range(len(t)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
    t_score += 1
    h_score += 1
   
print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if t == h:
  t_score += 1
  h_score += 1
  continue
 if len(t) > len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   h_score += 3
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 3

   
print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if t == h:
  t_score += 1
  h_score += 1
  continue
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   h_score += 3
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 3

   
print("{0} {1}".format(t_score, h_score))

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) == ord(h[0]):
        st += 1
        sh += 1
    else:
        sh += 3
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) == ord(h[0]):
        if len(t) > len(h):
            st += 3
        elif len(t) == len(h):
            st += 1
            sh += 1
        else:
            sh += 1
    else:
        sh += 3
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) == ord(h[0]):
        if len(t) > len(h):
            st += 3
        elif len(t) == len(h):
            st += 1
            sh += 1
        else:
            sh += 3
    else:
        sh += 3
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) < ord(h[0]):
        sh += 3
    else:
        m = len(h) if len(t) > len(h) else len(t)
        l = 1
        for j in range(m):
            if ord(t[j]) > ord(h[j]):
                st += 3
                j = m
                l = 0
            else:
                sh += 3
                j = m
                l = 0
        if l:
            st += 1
            sh += 1
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) < ord(h[0]):
        sh += 3
    else:
        m = len(h) if len(t) > len(h) else len(t)
        l = 1
        for j in range(m):
            if ord(t[j]) > ord(h[j]):
                st += 3
                l = 0
                break
            elif ord(t[j]) < ord(h[j]):
                sh += 3
                l = 0
                break
        if l:
            st += 1
            sh += 1
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) < ord(h[0]):
        sh += 3
    else:
        if len(t) > len(h):
            st += 3
        elif len(t) < len(h):
            sh += 3
        else:
            st += 1
            sh += 1
print(st, sh)

Submission status: Wrong Answer

Solution code:
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if t > h:
        st += 3
    elif t < h:
        sh += 3
    else:
        st += 1
        st += 1
print(st, sh)

Submission status: Wrong Answer

Solution code:
score = {"taro":0, "hanako":0}

n = int(input())

for i in range(n):
    words = input().split()

    if words[0] == words[1]: #ex:'abc'=='abc'
        score["taro"] += 1
        score["hanako"] += 1
    elif len(words[0]) < len(words[1]): #ex:'ab','abc' -> taro win
        if words[0] <= words[1][:len(words[0])]:
            score["taro"] += 3
        else:
            score["hanako"] += 3
    else:
        if words[1][:len(words[0])] <= words[0]:
            score["hanako"] += 3
        else:
            score["taro"] += 3

print(score["taro"], score["hanako"])

Submission status: Wrong Answer

Solution code:
n = int(input())
x,y = 0,0
for i in range(n):
    d = input().split()
    if d[0] == d[1]:
        x += 1
        y += 1
    else:
        a = list(d[0])
        b = list(d[1])
        for i in range(len(a)):
            if int(a[i],36) > int(b[i],36):
                x += 3
                break
            elif int(a[i],36) < int(b[i],36):
                y += 3
                break

print(x,y)

Submission status: Wrong Answer

Solution code:
n = int(input())
t_point = 0
h_point = 0
for i in range(n):
    card = input().split()
    print(card)
    taro = card[0]
    card.sort()
    card.reverse()
    print(card)
    if card[0] == card[1]:
        t_point += 1
        h_point += 1
    elif card[0] == taro:
        t_point += 3
    else:
        h_point += 3

print(t_point,h_point)

Submission status: Wrong Answer

Solution code:
round = int(input())
points =[0, 0]
for r in range(round):
    taro, hanako = input().split(" ")
    if taro[0] == hanako[0]:
        points[0] += 1
        points[1] += 1
    elif taro[0] > hanako[0]:
        points[0] += 3
    elif taro[0] < hanako[0]:
        points[1] += 3

print(*points)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
p_t = 0
p_h = 0

for i in range(n):
	taro, hanako = input().split()
	if taro == hanako:
		p_t += 1
		p_h += 1
	else:
		l_t = list(taro)
		l_h = (hanako)
		for j in range(min(len(l_t), len(l_h))):
			if l_t[j] != l_h[j]:
				if ord(l_t[j])<ord(l_h[j]):
					p_t += 3
					break
				else:
					p_h += 3
					break

print(p_t, p_h)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
p_t = 0
p_h = 0

for i in range(n):
	taro, hanako = input().split()
	if taro == hanako:
		p_t += 1
		p_h += 1
	else:
		l_t = list(taro)
		l_h = list(hanako)
		for j in range(min(len(l_t), len(l_h))):
			if l_t[j] != l_h[j]:
				if ord(l_t[j])<ord(l_h[j]):
					p_h += 3
					print('taro')
					break
				else:
					p_t += 3
					print('hanako')
					break

print(p_t, p_h)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
p_t = 0
p_h = 0

for i in range(n):
	taro, hanako = input().split()
	if taro == hanako:
		p_t += 1
		p_h += 1
	else:
		l_t = list(taro)
		l_h = list(hanako)
		for j in range(min(len(l_t), len(l_h))):
			if l_t[j] != l_h[j]:
				if ord(l_t[j])<ord(l_h[j]):
					p_h += 3
					#print('taro')
					break
				else:
					p_t += 3
					#print('hanako')
					break

print(p_t, p_h)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
p_t = 0
p_h = 0

for i in range(n):
	taro, hanako = input().split()
	if taro == hanako:
		p_t += 1
		p_h += 1
	else:
		l_t = list(taro)
		l_h = list(hanako)
		for j in range(min(len(l_t), len(l_h))):
			if l_t[j] != l_h[j]:
				if ord(l_t[j])<ord(l_h[j]):
					p_h += 3
					#print('taro')
					break
				else:
					p_t += 3
					#print('hanako')
					break
			else:
				if j == min(len(l_t), len(l_h)):
					if len(l_t)>len(l_h):
						p_t += 3
					else:
						p_h += 3
					

print(p_t, p_h)

Submission status: Wrong Answer

Solution code:
chrs = [chr(i) for i in range(97, 97+26)]
n = int(input())
score = [0, 0]
for i in range(n):
    [taro, hana] = input().split()
    t_num = chrs.index(taro[0])
    h_num = chrs.index(hana[0])
    if t_num>h_num:
        score[0] += 3
    elif h_num>t_num:
        score[1] += 3
    else:
        score[0] += 1
        score[1] += 1

print(score[0], score[1])

Submission status: Wrong Answer

Solution code:
count = int(input())
Taro_an = []
Hanako_an = []
Ts = 0
Hs = 0
for i in range(count) :
    animal = input().split(" ")
    Taro_an = animal[0]
    Hanako_an = animal[1]
    if Taro_an > Hanako_an :
        Ts += 3
    else :
        if Hanako_an > Taro_an :
            Hs += 3
        else :
            ++Ts, ++Hs
print(Ts,Hs)

Submission status: Wrong Answer

Solution code:
n = int(input())

score_taro, score_hanako = 0, 0
for _ in range(n):
    card_taro, card_hanako = input().split()

    point_taro, point_hanako = 0, 0
    if card_taro == card_hanako:
        point_taro = 1
        point_hanako = 1
        #print("draw")#
        continue
    for i in range(min(len(card_taro), len(card_hanako))):
        if len(card_taro) > len(card_hanako):
            point_taro = 3
        else:
            point_hanako = 3
        if ord(card_taro[i:i+1]) > ord(card_hanako[i:i+1]):
            point_taro = 3
            break
        if ord(card_taro[i:i+1]) < ord(card_hanako[i:i+1]):
            point_hanako = 3
            break

    score_taro += point_taro
    score_hanako += point_hanako

print("{0} {1}".format(score_taro, score_hanako))