摘要:
一共有n个台阶,每次跳一个或者两个,有多少种走法,典型的Fibonacii问题 还有一种,每次可以跳任意阶,有2^(n-1)种跳法 阅读全文
posted @ 2017-03-12 22:54
wilderness
阅读(131)
评论(0)
推荐(0)
摘要:
一个m*n的表格,每个格子有一个非负数,求从左上到右下最短的路径值 和62,63两个值是同一个思路,建立dp表,记录每个位置到右下角的最短路径的值 占用线性空间的解法: 阅读全文
posted @ 2017-03-12 22:26
wilderness
阅读(169)
评论(0)
推荐(0)
摘要:
用一个数组state记录已经选择的每一行皇后所在的位置,DFS 在整数shu,pie,na中用每个bit位记录已经被占用的 竖,撇,捺 阅读全文
posted @ 2017-03-12 17:56
wilderness
阅读(173)
评论(0)
推荐(0)
摘要:
Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space 阅读全文
posted @ 2017-03-12 17:03
wilderness
阅读(200)
评论(0)
推荐(0)
摘要:
判断一个物体从左上角到右下角有多少种走法 阅读全文
posted @ 2017-03-12 16:20
wilderness
阅读(116)
评论(0)
推荐(0)
摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2017-03-12 15:35
wilderness
阅读(167)
评论(0)
推荐(0)

浙公网安备 33010602011771号