Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- houses = list(map(int, input().split("@")))
- index = 0
- while True:
- command = input().split()
- if "Love!" in command:
- break
- index += int(command[1])
- if 0 > index or index >= len(houses):
- index = 0
- if houses[index] - 2 > 0:
- houses[index] -= 2
- elif houses[index] - 2 == 0:
- print(f"Place {index} has Valentine's day.")
- houses[index] = 0
- elif houses[index] - 2 < 0:
- print(f"Place {index} already had Valentine's day.")
- print(f"Cupid's last position was {index}.")
- if sum(houses) == 0:
- print(f"Mission was successful.")
- else:
- house_count = len([n for n in houses if n > 0])
- print(f"Cupid has failed {house_count} places.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement