Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- bullet_price = int(input())
- gun_barrel = int(input())
- bullets_stack = [int(s) for s in input().split()]
- locks_que = deque(int(s) for s in input().split())
- intelligence_value = int(input())
- bullets_shot = 0
- load = gun_barrel
- while bullets_stack and locks_que:
- current_bullet = bullets_stack.pop()
- bullets_shot += 1
- load -= 1
- if current_bullet <= locks_que[0]:
- locks_que.popleft()
- print("Bang!")
- else:
- print("Ping!")
- if load == 0 and bullets_stack:
- print("Reloading!")
- load = gun_barrel
- if not locks_que:
- print(f"{len(bullets_stack)} bullets left. Earned ${intelligence_value - (bullet_price * bullets_shot)}")
- else:
- print(f"Couldn't get through. Locks left: {len(locks_que)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement