Advertisement
lynulx

Untitled

Oct 27th, 2021
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def jopa(govno: list, dungeon_master: int, index: int):
  2.     if index == len(govno) - 1 or govno[index] < dungeon_master:
  3.         return index + 1
  4.     else:
  5.         qnt = govno[index] // dungeon_master
  6.         return max(
  7.             jopa(govno, dungeon_master, i)
  8.             for i in range(index+1, index + qnt+1)
  9.             )
  10.  
  11.  
  12. N = int(input())
  13. diff = int(input())
  14. count = 1
  15. flag = True
  16. jump_lengths = [int(input()) for _ in range(N)]
  17.  
  18. print(jopa(jump_lengths, diff, 0))
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement