pacho_the_python

Untitled

Oct 21st, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. record = int(input())
  2.  
  3. jumps = 0
  4. failed_jump = 0
  5. not_success = False
  6. lath_high = record - 30
  7. successful_jump = 0
  8. good_jump = 0
  9. for jump in range(10000):
  10.     current_jump = int(input())
  11.     jumps += 1
  12.     if current_jump <= lath_high:
  13.         failed_jump += 1
  14.         if failed_jump == 3:
  15.             not_success = True
  16.             break
  17.     if current_jump > lath_high:
  18.         successful_jump += 1
  19.         good_jump = lath_high
  20.         failed_jump = 0
  21.         lath_high += 5
  22.     if current_jump > record:
  23.         break
  24.  
  25. if not_success:
  26.     print(f"Tihomir failed at {lath_high}cm after {jumps} jumps.")
  27. if good_jump == record:
  28.     print(f"Tihomir succeeded, he jumped over {good_jump}cm after {jumps} jumps.")
Advertisement
Add Comment
Please, Sign In to add comment