PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#FW0000030. Kích nổ tối đa (Detonate the Maximum Bombs)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Kích nổ tối đa (Detonate the Maximum Bombs)
Detonate the Maximum Bombs
Source: LeetCode
Version: Phuoc Hung OJ Extended
Problem Statement
Each bomb has a center and a radius. Detonating one bomb triggers all bombs in its circular range, and the effect propagates. Maximize the number of detonated bombs.
Input
Integer , then lines .
Output
Print the maximum number of bombs that can detonate.
Subtasks
- Subtask 1 (40 points): ; , ; coordinates and radii are integers.
- Subtask 2 (60 points): , ; coordinates and radii are integers.
Examples
Input
2
2 1 3
6 1 4
Output
2
Explanation
The centers are distance apart. Radius of the first bomb cannot reach the second; radius of the second reaches the first, causing both explosions.