当前位置:网站首页>JZ71 跳台阶扩展问题
JZ71 跳台阶扩展问题
2022-07-25 18:13:00 【syc596】
JZ71 跳台阶扩展问题
跳台阶扩展问题_牛客题霸_牛客网 (nowcoder.com)
// //递归
// public class Solution {
// public int jumpFloorII(int target) {
// if(target<=1){
// return 1;
// }
// return 2*jumpFloorII(target-1);
// }
// }
//11
//动规dp
public class Solution {
public int jumpFloorII(int target) {
int[] dp=new int[target+1];
dp[0]=1;
dp[1]=1;
for(int i=2;i<=target;i++){
dp[i]=2*dp[i-1];
}
return dp[target];
}
}边栏推荐
- 408第二章线性表
- Stm32f105rbt6 internal flash debugging
- 喜讯!瑞云科技被授予“海上扬帆”5G融合应用专委会成员单位
- 程序的编译
- C语言 cJSON库的使用
- Oracle import error: imp-00038: unable to convert to environment character set handle
- Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"
- Cloud XR面临的问题以及Cloud XR主要应用场景
- Pan domain name configuration method
- 为什么数字化未来取决于3D实时渲染
猜你喜欢

超全Mavan标签详解

排序还需要了解的信息以及链表

Problems faced by cloud XR and main application scenarios of cloud XR

Cloud VR: the next step of virtual reality specialization

2022/7/23

LeetCode 101. 对称二叉树 && 100. 相同的树 && 572. 另一棵树的子树

What scenarios have rust, which is becoming more and more mature, applied?

Could not stop Cortex-M device! please check the JTAG cable的解决办法

3DCAT v2.1.3新版本发布,这三大功能更新你不容错过!

「数字安全」警惕 NFT的七大骗局
随机推荐
Use of join function in MATLAB
BiSeNet v1
"Digital security" alert NFT's seven Scams
Tme2022 campus recruitment background development / operation development / business operation and maintenance / application development written examination (I) a little self analysis of programming q
Postman get started quickly
如何选择数字孪生可视化平台
Conversion between integer and string in C language
Oracle导入出错:IMP-00038: 无法转换为环境字符集句柄
C语言 整数与字符串的相互转换
文件基础知识
List conversion problem
MySQL optimistic lock
UFT (QTP) - summary points and automated test framework
TESTNG中的并发测试invocationCount, threadPoolSize, timeOut的使用
Unittest framework application
Installation and operation instructions of SVN client (TortoiseSVN)
Mock服务moco系列(三)- 重定向、正则表达式、延迟、模板、事件、分模块设计
Wu Enda's machine learning programming operation cannot be suspended pause problem solved
408 Chapter 2 linear table
Joseph Ring problem