博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LeetCode:Climbing Stairs(DP)
阅读量:7103 次
发布时间:2019-06-28

本文共 455 字,大约阅读时间需要 1 分钟。

You are climbing a stair case. It takes n steps to reach to the top.

Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

 

1 class Solution { 2 public: 3     int climbStairs(int n) { 4          5          6         int *step_count=new int[n+1]; 7         step_count[1]=1; 8         step_count[2]=2; 9         10         //动归方程11         for(int i=3;i

 

转载于:https://www.cnblogs.com/xiaoying1245970347/p/4695768.html

你可能感兴趣的文章
区块链:新零售下一个核心突破点
查看>>
声纹识别技术:安全指数更高但其发展仍面临重重阻碍
查看>>
VR 影院,约吗?
查看>>
orm2 中文文档 3.1 模型属性
查看>>
雪城大学信息安全讲义 4.3~4.4
查看>>
JSP的客户端请求
查看>>
Memcached启动提示:cann't run as root without the -u switch
查看>>
300+参展品牌,10+同期会议,IOTE2018国际物联网展苏州开幕
查看>>
New Product Launch: Alibaba Cloud Data Integration
查看>>
人工智能玩具安全性遭质疑,刺痛了谁的神经?
查看>>
Mac系统下利用ADB命令连接android手机并进行文件操作
查看>>
修改Windows和linux系统时间
查看>>
深入VR教育乱象,教育部和工信部召开研讨会
查看>>
深入分析Spring 与 Spring MVC容器
查看>>
在已有元素后面插入一个新元素,属于通用型函数insertAfter(newElement,targetElement)...
查看>>
lesson6-表
查看>>
来自二维世界的忧愁:如何避免康康的悲剧再次重演?
查看>>
传教士与野人过河问题
查看>>
.NET Framework 3.5 Common Namespaces and Types Poster
查看>>
Winform应用程序实现通用遮罩层
查看>>