这道题的大致思路是:
首先读入所有的炸雷和排雷火箭的信息,存入对应的数组中。
循环遍历所有的排雷火箭,对于每个排雷火箭,再循环遍历所有的炸雷,判断这个炸雷是否在排雷火箭的爆炸范围内。
如果炸雷在排雷火箭的爆炸范围内,就将这个炸雷的标记设为"被引爆"。
最后统计所有被引爆的炸雷的个数,输出即可。
以下是具体的代码实现:
```java import java.util.Scanner;
public class Main { static int n, m; static boolean[] vis; static Mine[] mines; static Rocket[] rockets;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
m = sc.nextInt();
mines = new Mine[n];
rockets = new Rocket[m];
vis = new boolean[n];
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
int r = sc.nextInt();
mines[i] = new Mine(x, y, r);
}
for (int i = 0; i < m; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
int r = sc.nextInt();
rockets[i] = new Rocket(x, y, r);
}
sc.close();
// 循环遍历所有的排雷火箭
for (int i = 0; i < m; i++) {
// 再循环遍历所有的炸雷
for (int j = 0; j < n; j++) {
// 判断炸雷是否在排雷火箭的爆炸范围内
if (inRange(rockets[i], mines[j])) {
vis[j] = true;