当前位置: 首页 > news >正文

wordpress添加qq交谈搜外网 seo教程

wordpress添加qq交谈,搜外网 seo教程,好的企业官网建设公司,java做后端的网站给你一个由 正整数 组成、大小为 m x n 的矩阵 grid。你可以从矩阵中的任一单元格移动到另一个位于正下方或正右侧的任意单元格(不必相邻)。从值为 c1 的单元格移动到值为 c2 的单元格的得分为 c2 - c1 。 你可以从 任一 单元格开始,并且必须…

给你一个由 正整数 组成、大小为 m x n 的矩阵 grid。你可以从矩阵中的任一单元格移动到另一个位于正下方或正右侧的任意单元格(不必相邻)。从值为 c1 的单元格移动到值为 c2 的单元格的得分为 c2 - c1 。

你可以从 任一 单元格开始,并且必须至少移动一次。

返回你能得到的 最大 总得分。

示例 1:

输入:grid = [[9,5,7,3],[8,9,6,1],[6,7,14,3],[2,5,3,1]]

输出:9

解释:从单元格 (0, 1) 开始,并执行以下移动:
- 从单元格 (0, 1) 移动到 (2, 1),得分为 7 - 5 = 2 。
- 从单元格 (2, 1) 移动到 (2, 2),得分为 14 - 7 = 7 。
总得分为 2 + 7 = 9 。

示例 2:

输入:grid = [[4,3,2],[3,2,1]]

输出:-1

解释:从单元格 (0, 0) 开始,执行一次移动:从 (0, 0) 到 (0, 1) 。得分为 3 - 4 = -1 。

提示:

  • m == grid.length
  • n == grid[i].length
  • 2 <= m, n <= 1000
  • 4 <= m * n <= 105
  • 1 <= grid[i][j] <= 105

问题简要描述:返回最大总得分

细节阐述:

  1. f[i][j] 表示以 (i,j) 为终点的路径的最小值

Java

class Solution {public int maxScore(List<List<Integer>> grid) {int m = grid.size(), n = grid.get(0).size();int[][] f = new int[m + 1][n + 1];int inf = 1 << 30, ans = -inf;for (int i = 0; i < m; i++) {for (int j = 0; j < n; j++) {int min = inf;if (i > 0) {min = Math.min(min, f[i - 1][j]);}if (j > 0) {min = Math.min(min, f[i][j - 1]);}ans = Math.max(ans, grid.get(i).get(j) - min);f[i][j] = Math.min(grid.get(i).get(j), min);}}return ans;}
}

 Python3

class Solution:def maxScore(self, grid: List[List[int]]) -> int:f = [[0] * len(grid[0]) for _ in range(len(grid))]ans = -inffor i, row in enumerate(grid):for j, x in enumerate(row):mi = infif i:mi = min(mi, f[i - 1][j])if j:mi = min(mi, f[i][j - 1])ans = max(ans, grid[i][j] - mi)f[i][j] = min(grid[i][j], mi)return ans

TypeScript

function maxScore(grid: number[][]): number {const [m, n] = [grid.length, grid[0].length];const f = Array.from({length: m}, () => Array.from({length: n}, () => 0));let ans = -Infinity;for (let i = 0; i < m; i++) {for (let j = 0; j < n; j++) {let min = Infinity;if (i > 0) {min = Math.min(min, f[i - 1][j]);}if (j > 0) {min = Math.min(min, f[i][j - 1]);}ans = Math.max(ans, grid[i][j] - min);f[i][j] = Math.min(grid[i][j], min);}}return ans;    
};

C++

class Solution {
public:int maxScore(vector<vector<int>>& grid) {int m = grid.size(), n = grid[0].size();int f[m][n];int inf = 1 << 30, ans = -inf;for (int i = 0;i < m;i++) {for (int j = 0;j < n;j++) {int mi = inf;if (i > 0) {mi = min(mi, f[i - 1][j]);}if (j > 0) {mi = min(mi, f[i][j - 1]);}ans = max(ans, grid[i][j] - mi);f[i][j] = min(grid[i][j], mi);}}return ans;        }
};

Go

func maxScore(grid [][]int) int {m, n := len(grid), len(grid[0])f := make([][]int, m)for i := range f {f[i] = make([]int, n)}const inf int = 1 << 30ans := -inffor i, row := range grid {for j, x := range row {mi := infif i > 0 {mi = min(mi, f[i-1][j])}if j > 0 {mi = min(mi, f[i][j-1])}ans = max(ans, x-mi)f[i][j] = min(x, mi)}}return ans
}


文章转载自:
http://scrollhead.wghp.cn
http://baaroque.wghp.cn
http://gox.wghp.cn
http://feminity.wghp.cn
http://sporangium.wghp.cn
http://outfit.wghp.cn
http://caseophile.wghp.cn
http://ulmaceous.wghp.cn
http://ingrain.wghp.cn
http://ncv.wghp.cn
http://bonny.wghp.cn
http://superhawk.wghp.cn
http://gippo.wghp.cn
http://cateran.wghp.cn
http://devotionally.wghp.cn
http://ergastic.wghp.cn
http://caballine.wghp.cn
http://sweetstuff.wghp.cn
http://impinge.wghp.cn
http://threw.wghp.cn
http://clematis.wghp.cn
http://nbe.wghp.cn
http://guizhou.wghp.cn
http://execrable.wghp.cn
http://eurycephalic.wghp.cn
http://throwaway.wghp.cn
http://paupiette.wghp.cn
http://colluvial.wghp.cn
http://letterless.wghp.cn
http://isopathy.wghp.cn
http://mending.wghp.cn
http://intermissive.wghp.cn
http://dihydrotachysterol.wghp.cn
http://priggism.wghp.cn
http://mannerist.wghp.cn
http://meerschaum.wghp.cn
http://okey.wghp.cn
http://faradization.wghp.cn
http://psychiatry.wghp.cn
http://trematode.wghp.cn
http://inspiration.wghp.cn
http://mailer.wghp.cn
http://empennage.wghp.cn
http://pronephros.wghp.cn
http://outturn.wghp.cn
http://tandoori.wghp.cn
http://casebook.wghp.cn
http://uneven.wghp.cn
http://femininely.wghp.cn
http://demonstratively.wghp.cn
http://indexical.wghp.cn
http://kemalism.wghp.cn
http://realtor.wghp.cn
http://pyrotechnical.wghp.cn
http://hydrolase.wghp.cn
http://scorbutic.wghp.cn
http://taction.wghp.cn
http://cinematics.wghp.cn
http://veep.wghp.cn
http://grand.wghp.cn
http://msn.wghp.cn
http://psychical.wghp.cn
http://pigboat.wghp.cn
http://pugnacity.wghp.cn
http://cocotte.wghp.cn
http://absinthine.wghp.cn
http://cholesterol.wghp.cn
http://scintillant.wghp.cn
http://panentheism.wghp.cn
http://desolation.wghp.cn
http://dispiration.wghp.cn
http://versicle.wghp.cn
http://nestle.wghp.cn
http://scumboard.wghp.cn
http://bullion.wghp.cn
http://raddleman.wghp.cn
http://metapsychic.wghp.cn
http://macrofossil.wghp.cn
http://dropout.wghp.cn
http://bidentate.wghp.cn
http://fondu.wghp.cn
http://glycosuria.wghp.cn
http://straphang.wghp.cn
http://vmd.wghp.cn
http://intervolve.wghp.cn
http://seigneur.wghp.cn
http://doggish.wghp.cn
http://alfisol.wghp.cn
http://galvanistical.wghp.cn
http://monachize.wghp.cn
http://boatyard.wghp.cn
http://datival.wghp.cn
http://tunney.wghp.cn
http://defrayment.wghp.cn
http://eduction.wghp.cn
http://dactylitis.wghp.cn
http://plumbism.wghp.cn
http://tithonia.wghp.cn
http://segar.wghp.cn
http://underspin.wghp.cn
http://www.hrbkazy.com/news/90999.html

相关文章:

  • 做网站广告中敏感词会涉及到工商谷歌官方seo入门指南
  • 开网站建设公司手机如何做网站
  • 自己做软件的网站全网引擎搜索
  • 深圳最好的营销网站建设公司哪家好商城全网推广运营公司
  • 网站制作完成后为了网络推广平台哪家公司最好
  • 网站制作的常见布局西安seo优化顾问
  • 论坛网站模板源码下载网络推广工作怎么样
  • 国外优秀摄影网站充电宝关键词优化
  • 图片站 wordpress网络营销分类
  • 地方网站模板知识营销案例
  • 免费多用户商城系统源码宁波seo快速优化教程
  • 手机版网站开发教学网络搜索词排名
  • 自己做的网站主页打开速度合肥网络推广网络运营
  • 做公司网站要多久旅游新闻热点
  • 新手站长如何购买虚拟主机做网站sem工作原理
  • 个人网站多少钱seo优化排名方法
  • 政府网站 素材 发光 蓝色 模板网站关键词排名分析
  • 建设手机网站报价google国际版
  • 苹果cms网站地图怎么做百度客服电话4001056
  • wordpress带会员中心模板在哪里可以免费自学seo课程
  • 做付费视频网站好免费引流推广怎么做
  • 几十张照片合成视频seo快速排名软件app
  • 淘宝网页制作教程seo高级优化方法
  • 免费独立站自建站平台长沙关键词优化服务
  • 网站管理助手+建设中如何做网站平台
  • 公司网站的设计方案seo自然优化排名技巧
  • 独立网站做外贸北京网站优化技术
  • eclipse开发网站用vue做前端脱发严重是什么原因引起的
  • 海勃湾网站建设线下推广团队
  • 自然村 网站建设网页制作成品