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 ...
分类:
其他好文 时间:
2018-09-11 22:31:42
阅读次数:
195
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 ...
分类:
其他好文 时间:
2018-09-10 11:59:18
阅读次数:
166
假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢? ...
分类:
其他好文 时间:
2018-09-09 14:43:14
阅读次数:
161
1、题目描述 2、问题分析 使用动态规划。 3、代码 ...
分类:
其他好文 时间:
2018-09-02 23:41:39
阅读次数:
170
这道题本质上和 Climbing Stairs 那道DP题是一样的,但是由于 decode 有范围限制,所以写起来有很多条件。 dp[i] 表示到下标为i为止的字符能得到的解码个数 dp[i] += dp[i-1] if s[i]!='0' += dp[i-2] if s[i-1:i+1] in " ...
分类:
其他好文 时间:
2018-08-28 10:31:20
阅读次数:
149
70. 爬楼梯 https://leetcode-cn.com/problems/climbing-stairs/description/ ...
分类:
其他好文 时间:
2018-08-25 14:26:22
阅读次数:
127
1 class Solution { 2 public int climbStairs(int n) { 3 int[] s = new int[n + 1]; 4 s[1] = 1; s[0] = 1; 5 for(int i = 2; i <= n; i++) { 6 s[i] = s[i - ... ...
分类:
其他好文 时间:
2018-08-01 11:56:09
阅读次数:
108
接着上一次的题解接着写 E题,水题,The second line contains integers a1,a2,…,ana1,a2,…,an (1≤ai≤10001≤ai≤1000) — all the numbers Tanya pronounced while climbing the st ...
分类:
其他好文 时间:
2018-07-29 19:00:31
阅读次数:
150
Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from 11 to the numbe ...
分类:
其他好文 时间:
2018-07-28 11:38:00
阅读次数:
203
Little girl Tanya climbs the stairs inside a multi storey building. Every time Tanya climbs a stairway, she starts counting steps from 1 to the number ...
分类:
其他好文 时间:
2018-07-21 22:42:02
阅读次数:
230