Advertisement
a_yadvichuk

contest.py

Apr 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. n = int(input())
  2. a = [int (i) for i in input().split()]
  3. mx=max(a)
  4. maxm=0
  5. k=a.index(mx)
  6. for i in range(k+1,n-1):
  7.     if a[i] % 10 == 5 and a[i]>a[i+1] and maxm<a[i]:
  8.         maxm=a[i]
  9. a.sort(reverse = True)
  10. num = 1
  11. if maxm == 0:
  12.     print("0")
  13. else:
  14.     my=a.index(maxm)
  15.     print(my+1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement