Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rows = int(input())
- destroyed = 0
- field = []
- for i in range(rows):
- field.append(list(map(int, input().split())))
- attack = input().split()
- for j in range(len(attack)):
- current_attack = attack[j].split("-")
- curr_row = int(current_attack[0])
- curr_col = int(current_attack[1])
- if field[curr_row][curr_col] > 0:
- field[curr_row][curr_col] -= 1
- if field[curr_row][curr_col] == 0:
- destroyed += 1
- print(destroyed)
Advertisement
Add Comment
Please, Sign In to add comment