当前位置:网站首页>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];
}
}边栏推荐
- Postman get started quickly
- Stm32f105rbt6 internal flash debugging
- 实时云渲染有哪些优势
- Conversion between integer and string in C language
- Lwip之内存与包缓冲管理
- 专访即构科技李凯:音视频的有趣、行业前沿一直吸引着我
- CVE-2022-33891 Apache spark shell 命令注入漏洞复现
- 数二2010真题考点
- "Jargon" | what kind of experience is it to efficiently deliver games with Devops?
- SLA 、SLO & SLI
猜你喜欢

如何选择数字孪生可视化平台

What are the advantages of real-time cloud rendering

SQL那些事
SQL optimizer parsing | youth training camp notes

Related operations of figure

Oracle导入出错:IMP-00038: 无法转换为环境字符集句柄

"Jargon" | what kind of experience is it to efficiently deliver games with Devops?

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

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

"Digital security" alert NFT's seven Scams
随机推荐
How to read a Book
How to judge the performance of static code quality analysis tools? These five factors must be considered
Cloud VR: the next step of virtual reality specialization
MySQL lost the previous 0 after the decimal number type select
2022/7/23
H5 test point (mind map)
Could not stop Cortex-M device! please check the JTAG cable的解决办法
Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"
tkinter GUI版通信录管理系统
Mock服务moco系列(二)- Json格式、File文件、Header、Cookie、解决中文乱码
Unity 贝塞尔曲线的创建
testng执行顺序的3中控制方法
imx6 RTL8189FTV移植
Itextpdf realizes the merging of multiple PDF files into one PDF document
srec_ Use of common cat parameters
SVN客户端(TortoiseSVN)安装及使用说明
Problems faced by cloud XR and main application scenarios of cloud XR
实时云渲染有哪些优势
srec_cat 常用参数的使用
乐观锁解析