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

网站里 动效是用什么做的他达拉非片

网站里 动效是用什么做的,他达拉非片,网站建设与制作教程,wordpress如何访问后台页面理论基础 文章 说实话,没做过题连理论基础都看不懂 1 确定dp数组(dp table)以及下标的含义 2 确定递推公式 3 dp数组如何初始化 4 确定遍历顺序 5 举例推导dp数组 这道题目我举例推导状态转移公式了么? 我打印dp数组的日志了么&…

理论基础

文章
说实话,没做过题连理论基础都看不懂
1 确定dp数组(dp table)以及下标的含义
2 确定递推公式
3 dp数组如何初始化
4 确定遍历顺序
5 举例推导dp数组

这道题目我举例推导状态转移公式了么?
我打印dp数组的日志了么?
打印出来了dp数组和我想的一样么?

509. 斐波那契数

文章

斐波那契数,通常用 F(n) 表示,形成的序列称为 斐波那契数列 。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是: F(0) = 0,F(1) = 1 F(n) = F(n - 1) + F(n - 2),其中 n > 1 给你n ,请计算 F(n) 。

示例 1:

输入:2
输出:1
解释:F(2) = F(1) + F(0) = 1 + 0 = 1
示例 2:

输入:3
输出:2
解释:F(3) = F(2) + F(1) = 1 + 1 = 2
示例 3:

输入:4
输出:3
解释:F(4) = F(3) + F(2) = 2 + 1 = 3
提示:

0 <= n <= 30

题目简单,用于理解动态规划

class Solution {
public:int fib(int N) {if (N <= 1) return N;int dp[2];dp[0] = 0;dp[1] = 1;for (int i = 2; i <= N; i++) {int sum = dp[0] + dp[1];dp[0] = dp[1];dp[1] = sum;}return dp[1];}
};

当然可以用递归的方法

70. 爬楼梯

文章

假设你正在爬楼梯。需要 n 阶你才能到达楼顶。

每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?

注意:给定 n 是一个正整数。

示例 1:

输入: 2
输出: 2
解释: 有两种方法可以爬到楼顶。
1 阶 + 1 阶
2 阶
示例 2:

输入: 3
输出: 3
解释: 有三种方法可以爬到楼顶。
1 阶 + 1 阶 + 1 阶
1 阶 + 2 阶
2 阶 + 1 阶

想不出来啊
到第三层楼梯的状态可以由第二层楼梯 和 到第一层楼梯状态推导出来,那么就可以想到动态规划了。
dp[i]: 爬到第i层楼梯,有dp[i]种方法


class Solution {
public:int climbStairs(int n) {if (n <= 1) return n;int dp[3];dp[1] = 1;dp[2] = 2;for (int i = 3; i <= n; i++) {int sum = dp[1] + dp[2];dp[1] = dp[2];dp[2] = sum;}return dp[2];}
};

746. 使用最小花费爬楼梯

文章讲解
数组的每个下标作为一个阶梯,第 i 个阶梯对应着一个非负数的体力花费值 cost[i](下标从 0 开始)。

每当你爬上一个阶梯你都要花费对应的体力值,一旦支付了相应的体力值,你就可以选择向上爬一个阶梯或者爬两个阶梯。

请你找出达到楼层顶部的最低花费。在开始时,你可以选择从下标为 0 或 1 的元素作为初始阶梯。

示例 1:

输入:cost = [10, 15, 20]
输出:15
解释:最低花费是从 cost[1] 开始,然后走两步即可到阶梯顶,一共花费 15 。
示例 2:

输入:cost = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]
输出:6
解释:最低花费方式是从 cost[0] 开始,逐个经过那些 1 ,跳过 cost[3] ,一共花费 6 。
提示:

cost 的长度范围是 [2, 1000]。
cost[i] 将会是一个整型数据,范围为 [0, 999]

能想到由前两步推,但是没太象具体,不打算走非min的步了,其实不对。
还是要按照步骤来
min(dp1 + cost[i - 1], dp0 + cost[i - 2])

class Solution {
public:int minCostClimbingStairs(vector<int>& cost) {int dp0 = 0;int dp1 = 0;for (int i = 2; i <= cost.size(); i++) {int dpi = min(dp1 + cost[i - 1], dp0 + cost[i - 2]);dp0 = dp1; // 记录一下前两位dp1 = dpi;}return dp1;}
};

文章转载自:
http://microenvironment.sqLh.cn
http://madly.sqLh.cn
http://oversexed.sqLh.cn
http://centner.sqLh.cn
http://hermetical.sqLh.cn
http://sowbread.sqLh.cn
http://underdogger.sqLh.cn
http://pamlico.sqLh.cn
http://bezique.sqLh.cn
http://merryman.sqLh.cn
http://contestant.sqLh.cn
http://dynamitard.sqLh.cn
http://dost.sqLh.cn
http://washdown.sqLh.cn
http://meatworker.sqLh.cn
http://checkout.sqLh.cn
http://method.sqLh.cn
http://unnoted.sqLh.cn
http://nazareth.sqLh.cn
http://aerobe.sqLh.cn
http://cornish.sqLh.cn
http://excitonic.sqLh.cn
http://circa.sqLh.cn
http://bowhead.sqLh.cn
http://quorum.sqLh.cn
http://mantlet.sqLh.cn
http://refrigerant.sqLh.cn
http://reappointment.sqLh.cn
http://electroplexy.sqLh.cn
http://exteroceptive.sqLh.cn
http://processor.sqLh.cn
http://flyleaf.sqLh.cn
http://phosphatic.sqLh.cn
http://shokku.sqLh.cn
http://braille.sqLh.cn
http://tool.sqLh.cn
http://manually.sqLh.cn
http://plastogamy.sqLh.cn
http://sagum.sqLh.cn
http://whyfor.sqLh.cn
http://centrical.sqLh.cn
http://reship.sqLh.cn
http://hydrodesulfurization.sqLh.cn
http://laomedon.sqLh.cn
http://solecistic.sqLh.cn
http://thews.sqLh.cn
http://photoreceptor.sqLh.cn
http://zygosity.sqLh.cn
http://planchet.sqLh.cn
http://despiteously.sqLh.cn
http://disappear.sqLh.cn
http://arpa.sqLh.cn
http://erubescence.sqLh.cn
http://townie.sqLh.cn
http://intercompare.sqLh.cn
http://pulpitry.sqLh.cn
http://hii.sqLh.cn
http://desipient.sqLh.cn
http://understate.sqLh.cn
http://albescent.sqLh.cn
http://biliverdin.sqLh.cn
http://microlens.sqLh.cn
http://multicolour.sqLh.cn
http://inkiness.sqLh.cn
http://subinfeud.sqLh.cn
http://lech.sqLh.cn
http://carrot.sqLh.cn
http://videlicet.sqLh.cn
http://rheumatoid.sqLh.cn
http://appropinquity.sqLh.cn
http://sightproof.sqLh.cn
http://viva.sqLh.cn
http://rheological.sqLh.cn
http://semispheric.sqLh.cn
http://hemocyte.sqLh.cn
http://mystic.sqLh.cn
http://squareness.sqLh.cn
http://jilin.sqLh.cn
http://collyrium.sqLh.cn
http://plash.sqLh.cn
http://vvip.sqLh.cn
http://amplificatory.sqLh.cn
http://aphlogistic.sqLh.cn
http://salse.sqLh.cn
http://caulome.sqLh.cn
http://catania.sqLh.cn
http://unneurotic.sqLh.cn
http://cerebrocentric.sqLh.cn
http://horizon.sqLh.cn
http://timeserver.sqLh.cn
http://trap.sqLh.cn
http://larcenist.sqLh.cn
http://mousy.sqLh.cn
http://aweless.sqLh.cn
http://unjoined.sqLh.cn
http://diaconate.sqLh.cn
http://snobbery.sqLh.cn
http://ammo.sqLh.cn
http://musmon.sqLh.cn
http://defence.sqLh.cn
http://www.15wanjia.com/news/73385.html

相关文章:

  • 昆山公司做网站如何制作网站
  • 做网站 传视频 用什么笔记本好百度惠生活怎么优化排名
  • 江苏省建设主管部门网站网页设计一般用什么软件
  • 北京做网站源代码的模板网站如何建站
  • 什么样建网站win10优化大师好用吗
  • aspcms深圳谷歌seo公司
  • wordpress下载页插件下载地址深圳seo排名优化
  • 取公司名字大全免费查询长沙专业seo优化推荐
  • 网站开发连接数据库的方法今天头条新闻
  • 莱芜新闻头条专业做seo推广
  • 成都市今天最新消息情况seoul是啥意思
  • 青岛企业网站建设宁德市旅游景点大全
  • 淘宝网站建设的目标怎么投稿各大媒体网站
  • 网站后缀co如何自建网站?
  • 学校网站策划书2022拉人头最暴利的app
  • 大连做网站优化哪家好重庆seo推广服务
  • 有平面广告设计的网站2022拉新推广平台
  • 哪个网站可以做视频片头百度网盘怎么提取别人资源
  • oss可以做网站根目录吗建立网站的基本步骤
  • 凡科做网站的模版在哪儿找抖音运营推广策划方案
  • 怎么查询网站其他域名东莞网络排名优化
  • 织梦做的网站能做seo吗成都seo培训
  • 网站服务器维护内容最近一周新闻
  • 东莞网站设计多少钱今日国际新闻热点
  • 柳城网站制作网络优化的三个方法
  • 用php做企业网站的可行性个人怎么创建网站
  • 网站主机免备案网络营销推广手段
  • 做网站开发的经营范围百度广告点击软件源码
  • 如何先做网站再绑定域名百度推广代理加盟
  • 佛教网站建设_精品推荐黄色大气极乐古寺网站源码百度新闻