mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给你一个二维整数数组 <code>circles</code> ,其中 <code>circles[i] = [x<sub>i</sub>, y<sub>i</sub>, r<sub>i</sub>]</code> 表示网格上圆心为 <code>(x<sub>i</sub>, y<sub>i</sub>)</code> 且半径为 <code>r<sub>i</sub></code> 的第 <code>i</code> 个圆,返回出现在<strong> 至少一个 </strong>圆内的 <strong>格点数目</strong> 。</p>
 | 
						||
 | 
						||
<p><strong>注意:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><strong>格点</strong> 是指整数坐标对应的点。</li>
 | 
						||
	<li><strong>圆周上的点</strong> 也被视为出现在圆内的点。</li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/03/02/exa-11.png" style="width: 300px; height: 300px;" /></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>circles = [[2,2,1]]
 | 
						||
<strong>输出:</strong>5
 | 
						||
<strong>解释:</strong>
 | 
						||
给定的圆如上图所示。
 | 
						||
出现在圆内的格点为 (1, 2)、(2, 1)、(2, 2)、(2, 3) 和 (3, 2),在图中用绿色标识。
 | 
						||
像 (1, 1) 和 (1, 3) 这样用红色标识的点,并未出现在圆内。
 | 
						||
因此,出现在至少一个圆内的格点数目是 5 。</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/03/02/exa-22.png" style="width: 300px; height: 300px;" /></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>circles = [[2,2,2],[3,4,1]]
 | 
						||
<strong>输出:</strong>16
 | 
						||
<strong>解释:</strong>
 | 
						||
给定的圆如上图所示。
 | 
						||
共有 16 个格点出现在至少一个圆内。
 | 
						||
其中部分点的坐标是 (0, 2)、(2, 0)、(2, 4)、(3, 2) 和 (4, 4) 。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= circles.length <= 200</code></li>
 | 
						||
	<li><code>circles[i].length == 3</code></li>
 | 
						||
	<li><code>1 <= x<sub>i</sub>, y<sub>i</sub> <= 100</code></li>
 | 
						||
	<li><code>1 <= r<sub>i</sub> <= min(x<sub>i</sub>, y<sub>i</sub>)</code></li>
 | 
						||
</ul>
 |