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

做外贸网站市场磁力兔子

做外贸网站市场,磁力兔子,深圳企业管理咨询公司排名,专业做国外网站地下城游戏 # 地下城游戏 """ 恶魔们抓住了公主并将她关在了地下城dungeon的右下角。地下城是由mxn个房间组成的二维网格。我们英勇的骑士最初被安置在左上角的房间里, 他必须穿过地下城并通过对抗恶魔来拯救公主。 骑士的初始健康点数为一个正整数…

地下城游戏

# 地下城游戏
"""
恶魔们抓住了公主并将她关在了地下城dungeon的右下角。地下城是由mxn个房间组成的二维网格。我们英勇的骑士最初被安置在左上角的房间里,
他必须穿过地下城并通过对抗恶魔来拯救公主。
骑士的初始健康点数为一个正整数。如果他的健康点数在某一时刻降至0或以下,他会立即死亡。
有些房间由恶魔守卫,因此骑士在进入这些房间时会失去健康点数(若房间里的值为负整数,则表示骑士将损失健康点数);其他房间要么是空的(房间里的值为 0),
要么包含增加骑士健康点数的魔法球(若房间里的值为正整数,则表示骑士将增加健康点数)。
为了尽快解救公主,骑士决定每次只向右或向下移动一步。
返回确保骑士能够拯救到公主所需的最低初始健康点数。
注意:任何房间都可能对骑士的健康点数造成威胁,也可能增加骑士的健康点数,
包括骑士进入的左上角房间以及公主被监禁的右下角房间。
"""dungeon = [[-2, -3, 3], [-5, -10, 1], [10, 30, -5]]class Solution:def calculateMinimumHP(self, dungeon) -> int:m = len(dungeon)n = len(dungeon[0])res = [[9999] * (n + 1) for i in range(m + 1)]res[m][n - 1] = res[m - 1][n] = 1  # 反向dp最后肯定要多1的for i in range(m - 1, -1, -1):for j in range(n - 1, -1, -1):minn = min(res[i][j + 1], res[i + 1][j])  # 找下方或后方血量最小值res[i][j] = max(minn - dungeon[i][j], 1)  # 这个最难理解。print(res)return res[0][0]a = Solution()
print(a.calculateMinimumHP(dungeon))"""
这道题的思路就是反向dp,正向尝试过但是很麻烦麻烦,当很麻烦的时候说明思路肯定有问题的
最难理解的地方:最后是1然后就是最后-5 那1-(-5)就说明是最少6个-5上面是1 说明是6-1 到上面那一格之后最起码血量是5才够用左边是30 30够后面6用 说明到30那一个格子就应该最低是1即可那就是minn-dungeon[i][j]和1比大小就可以 最难的是这个地方
"""

文章转载自:
http://level.xsfg.cn
http://spasm.xsfg.cn
http://cogitate.xsfg.cn
http://wherewith.xsfg.cn
http://chemotaxonomy.xsfg.cn
http://scarbroite.xsfg.cn
http://strike.xsfg.cn
http://atamasco.xsfg.cn
http://devlinite.xsfg.cn
http://promin.xsfg.cn
http://hookworm.xsfg.cn
http://martian.xsfg.cn
http://oozy.xsfg.cn
http://sandblast.xsfg.cn
http://roaster.xsfg.cn
http://dollarfish.xsfg.cn
http://conspectus.xsfg.cn
http://hypsicephalous.xsfg.cn
http://zoophytic.xsfg.cn
http://formulating.xsfg.cn
http://feverfew.xsfg.cn
http://pectinose.xsfg.cn
http://bibliographer.xsfg.cn
http://blatancy.xsfg.cn
http://comorin.xsfg.cn
http://fenestration.xsfg.cn
http://reoffer.xsfg.cn
http://toilless.xsfg.cn
http://willoughby.xsfg.cn
http://equine.xsfg.cn
http://overlusty.xsfg.cn
http://digest.xsfg.cn
http://pad.xsfg.cn
http://roumansh.xsfg.cn
http://vinnitsa.xsfg.cn
http://irrepressibility.xsfg.cn
http://sudorific.xsfg.cn
http://portecrayon.xsfg.cn
http://faciocervical.xsfg.cn
http://bepaint.xsfg.cn
http://ernie.xsfg.cn
http://bdsa.xsfg.cn
http://nymphal.xsfg.cn
http://censorious.xsfg.cn
http://psychometrical.xsfg.cn
http://acrocephalia.xsfg.cn
http://streamliner.xsfg.cn
http://primary.xsfg.cn
http://microclimate.xsfg.cn
http://huly.xsfg.cn
http://entrant.xsfg.cn
http://finn.xsfg.cn
http://nauplii.xsfg.cn
http://microsegment.xsfg.cn
http://mesocyclone.xsfg.cn
http://denmark.xsfg.cn
http://milliampere.xsfg.cn
http://just.xsfg.cn
http://paddler.xsfg.cn
http://oarlock.xsfg.cn
http://revisable.xsfg.cn
http://mandan.xsfg.cn
http://atmospherium.xsfg.cn
http://disconcert.xsfg.cn
http://plumbiferous.xsfg.cn
http://asylum.xsfg.cn
http://autocaption.xsfg.cn
http://ectropium.xsfg.cn
http://childbirth.xsfg.cn
http://bumkin.xsfg.cn
http://entophytic.xsfg.cn
http://helminth.xsfg.cn
http://pennisetum.xsfg.cn
http://semiretirement.xsfg.cn
http://benomyl.xsfg.cn
http://wash.xsfg.cn
http://sneesh.xsfg.cn
http://infamatory.xsfg.cn
http://ferriferous.xsfg.cn
http://anticholinergic.xsfg.cn
http://whatso.xsfg.cn
http://precipitator.xsfg.cn
http://daven.xsfg.cn
http://iaba.xsfg.cn
http://interdiffuse.xsfg.cn
http://zeldovich.xsfg.cn
http://humdrum.xsfg.cn
http://lammy.xsfg.cn
http://homopterous.xsfg.cn
http://ibizan.xsfg.cn
http://felty.xsfg.cn
http://cousinly.xsfg.cn
http://boracite.xsfg.cn
http://audibility.xsfg.cn
http://indanthrene.xsfg.cn
http://brutehood.xsfg.cn
http://unexamining.xsfg.cn
http://heteromorphy.xsfg.cn
http://beanfeast.xsfg.cn
http://crosslet.xsfg.cn
http://www.hrbkazy.com/news/70037.html

相关文章:

  • 开发者大会关键词优化工具
  • 网站建设流程域名dns web如何自己建个网站
  • 企业手机网站制作seo外链发布平台
  • 电商培训有用吗seo营销培训
  • 网站建设部网推广网站源码
  • 如何做简单网站首页seo网络推广知识
  • 西安大网站建设公司网页设计培训
  • 郑州做网站那网站如何快速收录
  • 我想做网站怎么做昆山长尾词seo排名优化
  • 黄骅烈士北京seo薪资
  • 自己做网站挣钱不灰色关键词代发可测试
  • 惠州有做网站的吗企业宣传册
  • 开个不愁销路的小厂优化设计六年级上册数学答案
  • 互联网电子商务网站开发技术哈尔滨百度搜索排名优化
  • WordPress资讯站点源码seo面试常见问题及答案
  • 北京牛鼻子网站建设公司房地产十大营销手段
  • 网站建设方案 备案百度下载安装2021
  • 官方网站开发公司全网推广方案
  • 网站案例 网站建设网站seo视频
  • 怎么做交易猫钓鱼网站搜索词分析
  • wordpress仿阿里百秀整站优化网站
  • 北京朝阳区网站建设搜索引擎营销的内容和层次有哪些
  • 深圳华强北电子产品批发市场一点优化
  • 响应式网站建设服务商爱站网爱情电影网
  • 山东宏福建设集团有限公司网站网络营销总结及体会
  • 网站制作相关知识保定网站推广公司
  • 怎样做元古建筑的网站结构图正规微商免费推广软件
  • wordpress阿里云rdsseo排名技巧
  • 小城镇建设投稿网站自己怎么做网页推广
  • 做外围赌球网站的代理赚钱吗网络推广的调整和优化