码迷,mamicode.com
首页 >  
搜索关键字:climbing stairs    ( 401个结果
LeetCode 70 Climbing Stairs
Problem: 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 c ...
分类:其他好文   时间:2016-11-05 09:17:16    阅读次数:292
leetcode 70 Climbing Stairs ----- java
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 cl ...
分类:编程语言   时间:2016-10-13 02:01:40    阅读次数:127
Snapchat - give sum target list<Integer> first who hits target wins
// DP 从 1-N 不重复取数 加到sum 上 第一个超过target赢 先手可以赢吗? 开始想错了,以为和climbing stairs和combination sum iv一个类型,是一个dfs 代码: ...
分类:Windows程序   时间:2016-10-09 09:06:15    阅读次数:191
模拟退火算法简介
优化算法入门系列文章目录(更新中): 1. 模拟退火算法 2. 遗传算法 一. 爬山算法 ( Hill Climbing ) 介绍模拟退火前,先介绍爬山算法。爬山算法是一种简单的贪心搜索算法,该算法每次从当前解的临近解空间中选择一个最优解作为当前解,直到达到一个局部最优解。 爬山算法实现很简单,其主 ...
分类:编程语言   时间:2016-10-06 00:32:50    阅读次数:150
[Matlab]二维统计分析图实例
常见的二维统计分析图形: bar(x,y,选项) 条形图 stairs(x,y,选项) 阶梯图 stem(x,y,选项) 杆图 fill(x1,y1,选项1,x2,y2,选项2,……) 填充图 实例:绘制曲线y=2sin(x) x = 0:pi/10:2*pi; y = 2*sin(x); subp ...
分类:其他好文   时间:2016-10-04 22:57:19    阅读次数:436
377. Combination Sum IV
是看到discuss里面的解法,因为用backtracking实在太多可能性了 思路是和https://leetcode.com/problems/climbing-stairs/ 在climbing stairs里面假如有n个台阶,每次可以跨一个台阶或者两个台阶,那么它的状态转移方程是res[i] ...
分类:其他好文   时间:2016-09-30 09:47:26    阅读次数:142
LeetCode 70. Climbing Stairs
题意:走楼梯,你一共要走n个阶梯才能到达楼顶。你每次只能走一个阶梯或者两个阶梯,请问你有多少种走法。 思路:动态规划,d[n]代表走n个阶梯的总共走法:走到第n个阶梯有两种可能,那就是从第n-1个阶梯走一个阶梯就到了,或者从第n-2个阶梯走两个阶梯就到了。 所以d[n] = d[n-1] + d[n ...
分类:其他好文   时间:2016-09-25 10:44:14    阅读次数:208
LeetCode 70. Climbing Stairs
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 cl ...
分类:其他好文   时间:2016-09-16 22:53:34    阅读次数:136
70. Climbing Stairs
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 cl ...
分类:其他好文   时间:2016-09-15 13:48:26    阅读次数:116
70. Climbing Stairs
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 cl ...
分类:其他好文   时间:2016-09-15 13:37:24    阅读次数:116
401条   上一页 1 ... 13 14 15 16 17 ... 41 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!