-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorrida_escola.py
44 lines (34 loc) · 876 Bytes
/
corrida_escola.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
n, m = input().split()
n, m = int(n), int(m)
voltas = {}
def corridas():
for i in range(1, n+1):
try:
tempo = input().split()
voltas[i] = [int(t) for t in tempo]
except:
break
tempos_totais = {}
for i in voltas:
tempos_totais[i] = sum(voltas[i])
vencedor = min(tempos_totais, key=tempos_totais.get)
return vencedor
vencedor = corridas()
print(vencedor)
n, m = input().split()
n, m = int(n), int(m)
voltas = {}
def corridas():
for i in range(1, n+1):
try:
tempo = input().split()
voltas[i] = [int(t) for t in tempo]
except:
break
tempos_totais = {}
for i in voltas:
tempos_totais[i] = sum(voltas[i])
vencedor = min(tempos_totais, key=tempos_totais.get)
return vencedor
vencedor = corridas()
print(vencedor)