Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- price_of_bullet = int(input())
- size_of_gun = int(input())
- bullets = list(map(int, input().split()))
- bullets_size = len(bullets)
- locks = deque(map(int, input().split()))
- locks_size = len(locks)
- value_of_intelligence = int(input())
- bullets_num = 0
- lock_num = 0
- while True:
- if not bullets:
- break
- if not locks:
- break
- if locks[0] >= bullets[-1]:
- print("Bang!")
- bullets.pop()
- locks.popleft()
- bullets_num += 1
- lock_num += 1
- else:
- print("Ping!")
- bullets.pop()
- bullets_num += 1
- if bullets_num % size_of_gun == 0 and bullets:
- print("Reloading!")
- bullets_cost = price_of_bullet * bullets_num
- money_earned = value_of_intelligence - bullets_cost
- bullets_left = bullets_size - bullets_num
- locks_left = locks_size - lock_num
- if bullets_left >= 0:
- if locks_left <= 0:
- print(f"{bullets_left} bullets left. Earned ${money_earned}")
- else:
- print(f"Couldn't get through. Locks left: {locks_left}")
Advertisement
Add Comment
Please, Sign In to add comment