fork download
  1. from functools import reduce
  2.  
  3. def f(array):
  4. evenElements = array[::2]
  5. if sorted(evenElements) == evenElements:
  6. return reduce(lambda x, y: x * y, evenElements, 1)
  7. else:
  8. return [i for i, x in enumerate(array) if x > 0]
  9.  
  10. lst = list(map(int, input().split()))
  11. print(f(lst))
Success #stdin #stdout 0.02s 9360KB
stdin
6 5 4 3 2 1
stdout
[0, 1, 2, 3, 4, 5]