mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			900 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			900 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p><strong>n 皇后问题</strong> 研究的是如何将 <code>n</code> 个皇后放置在 <code>n × n</code> 的棋盘上,并且使皇后彼此之间不能相互攻击。</p>
 | 
						||
 | 
						||
<p>给你一个整数 <code>n</code> ,返回 <strong>n 皇后问题</strong> 不同的解决方案的数量。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<div class="original__bRMd">
 | 
						||
<div>
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
<img alt="" src="https://assets.leetcode.com/uploads/2020/11/13/queens.jpg" style="width: 600px; height: 268px;" />
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>n = 4
 | 
						||
<strong>输出:</strong>2
 | 
						||
<strong>解释:</strong>如上图所示,4 皇后问题存在两个不同的解法。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入:</strong>n = 1
 | 
						||
<strong>输出:</strong>1
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= n <= 9</code></li>
 | 
						||
</ul>
 | 
						||
</div>
 | 
						||
</div>
 |