mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			801 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			801 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>在一个 m*n 的棋盘的每一格都放有一个礼物,每个礼物都有一定的价值(价值大于 0)。你可以从棋盘的左上角开始拿格子里的礼物,并每次向右或者向下移动一格、直到到达棋盘的右下角。给定一个棋盘及其上面的礼物的价值,请计算你最多能拿到多少价值的礼物?</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre><strong>输入:</strong> 
 | 
						||
<code>[
 | 
						||
  [1,3,1],
 | 
						||
  [1,5,1],
 | 
						||
  [4,2,1]
 | 
						||
]</code>
 | 
						||
<strong>输出:</strong> <code>12
 | 
						||
</code><strong>解释:</strong> 路径 1→3→5→2→1 可以拿到最多价值的礼物</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p>提示:</p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>0 < grid.length <= 200</code></li>
 | 
						||
	<li><code>0 < grid[0].length <= 200</code></li>
 | 
						||
</ul>
 |