mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			31 lines
		
	
	
		
			809 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			809 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>给你一个整数 <code>n</code>,请你返回 <strong>任意 </strong>一个由 <code>n</code> 个 <strong>各不相同 </strong>的整数组成的数组,并且这 <code>n</code> 个数相加和为 <code>0</code> 。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>n = 5
 | 
						||
<strong>输出:</strong>[-7,-1,1,3,4]
 | 
						||
<strong>解释:</strong>这些数组也是正确的 [-5,-1,1,2,3],[-3,-1,2,-2,4]。
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>n = 3
 | 
						||
<strong>输出:</strong>[-1,0,1]
 | 
						||
</pre>
 | 
						||
 | 
						||
<p><strong>示例 3:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong>n = 1
 | 
						||
<strong>输出:</strong>[0]
 | 
						||
</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>1 <= n <= 1000</code></li>
 | 
						||
</ul>
 |