TEMA

15%wrong ans in python

nameless55 preguntado 3 years ago

a = list(map(int, input().split()))
frog_jump_height = a[0]
last_value = a[1]-1
pipes = list(map(int, input().split()))
ans = "YOU WIN"
pipe_height = 0
for i in pipes:
    if pipes.index(i) == last_value and i == pipes[-1]:
        break
    else:
        pipe_height = i - pipes[pipes.index(i)+1]

        if abs(pipe_height)>frog_jump_height:
            ans = "GAME OVER"
            break
print(ans)

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

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