Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ilosc_kwadratow = int(input())
  2. #kwadraty = []
  3. kwadraty = input().split()
  4. a = 0
  5. while (a < ilosc_kwadratow):
  6. kwadraty[a] = int(kwadraty[a])
  7. a+=1
  8. maksymalne_skoki = 0
  9. #kwadraty.append(0)
  10. b = 0
  11. while (b < ilosc_kwadratow-1):
  12. skoki = 0
  13. miejsce = kwadraty[b]
  14. c = b
  15. while (c < ilosc_kwadratow-1):
  16. if (kwadraty[c+1] <= miejsce):
  17. skoki+=1
  18. miejsce = kwadraty[c+1]
  19. if(skoki > maksymalne_skoki):
  20. maksymalne_skoki = skoki
  21. else:
  22. skoki=0
  23. miejsce = kwadraty[c+1]
  24. c+=1
  25. b+=1
  26. print(maksymalne_skoki)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement