# TEMA

30% W.A - Alguém..?

#### ┳⋃Đʘ ϾƕƲƥƗȵɢ₳ ↓↓↓ preguntado 2 years ago

``````def who_won(match):
if match[0] > match[1]:
return 1
elif match[1] > match[0]:
return 2
else:
return 0

def compute_points(winner):
if winner == 1:
teams[1]['points'] += 3
elif winner == 2:
teams[2]['points'] += 3
else:
teams[1]['points'] += 1
teams[2]['points'] += 1

return list(map(int, map(str.strip, input().split('x'))))

cases = int(input())

for i in range(cases):
teams = {
1: {'points': 0, 'sd': 0, 'outhome': 0}
,2: {'points': 0, 'sd': 0, 'outhome': 0}
}

teams[1]['sd'] = (match1[0] + match2[1]) - (match1[1] + match2[0])
teams[2]['sd'] = (match1[1] + match2[0]) - (match1[0] + match2[1])

teams[1]['outhome'] = match2[1]
teams[2]['outhome'] = match1[1]

match2.reverse()

compute_points(who_won(match1))
compute_points(who_won(match2))

if teams[1]['points'] > teams[2]['points']:
print('Time 1')
elif teams[2]['points'] > teams[1]['points']:
print('Time 2')
else:
if teams[1]['sd'] > teams[2]['sd']:
print('Time 1')
elif teams[2]['sd'] > teams[2]['sd']:
print('Time 2')
else:
if teams[1]['outhome'] > teams[2]['outhome']:
print('Time 1')
elif teams[2]['outhome'] > teams[2]['outhome']:
print('Time 2')
else:
print('Penaltis')``````

Este tema aún no ha sido contestado. ¡Sé el primero!

Recuerda no enviar soluciones. Tu mensaje puede ser revisado por nuestros moderadores.