以下是用 Python 写的代码:
from collections import defaultdict
def explode_bombs(targets, R):
target_map = defaultdict(int)
for target in targets:
x, y, w = target
for i in range(x - R, x + R + 1):
for j in range(y - R, y + R + 1):
target_map[(i, j)]