Skip to content

Commit 52518cc

Browse files
committed
deploy: 0707720
1 parent e3e3f0c commit 52518cc

File tree

6 files changed

+255
-291
lines changed

6 files changed

+255
-291
lines changed

en/lc/2094/index.html

Lines changed: 126 additions & 144 deletions
Large diffs are not rendered by default.

en/lc/2101/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77607,7 +77607,7 @@ <h3 id="solution-1-bfs">Solution 1: BFS</h3>
7760777607
<p>We define an array $g$ of length $n$, where $g[i]$ represents the indices of all bombs that can be triggered by bomb $i$ within its explosion range.</p>
7760877608
<p>Next, we iterate over all bombs. For two bombs $(x_1, y_1, r_1)$ and $(x_2, y_2, r_2)$, we calculate the distance between them $\text{dist} = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$. If $\text{dist} \leq r_1$, then bomb $i$ can trigger bomb $j$ within its explosion range, so we add $j$ to $g[i]$. If $\text{dist} \leq r_2$, then bomb $j$ can trigger bomb $i$ within its explosion range, so we add $i$ to $g[j]$.</p>
7760977609
<p>Next, we iterate over all bombs. For each bomb $k$, we use breadth-first search to calculate the indices of all bombs that can be triggered by bomb $k$ within its explosion range and record them. If the number of these bombs equals $n$, then we can trigger all bombs and directly return $n$. Otherwise, we record the number of these bombs and return the maximum value.</p>
77610-
<p>The time complexity is $O(n^2)$ and the space complexity is $O(n^2)$, where $n$ is the number of bombs.</p>
77610+
<p>The time complexity is $O(n^3)$ and the space complexity is $O(n^2)$, where $n$ is the number of bombs.</p>
7761177611
<div class="tabbed-set tabbed-alternate" data-tabs="1:5"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><input id="__tabbed_1_3" name="__tabbed_1" type="radio" /><input id="__tabbed_1_4" name="__tabbed_1" type="radio" /><input id="__tabbed_1_5" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Python3</label><label for="__tabbed_1_2">Java</label><label for="__tabbed_1_3">C++</label><label for="__tabbed_1_4">Go</label><label for="__tabbed_1_5">TypeScript</label></div>
7761277612
<div class="tabbed-content">
7761377613
<div class="tabbed-block">

en/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)