Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- star = list(map(int, input().split()))
- attacked = 1
- count = 0
- while True:
- if count < 0 or count == n:
- break
- else:
- if star[count] == 0:
- break
- elif star[count] % 2 == 0:
- star[count] -= 1
- count = count - 1
- else:
- star[count] -= 1
- count = count + 1
- attacked += 1
- print(attacked)
- print(sum(star))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement