斐波那契转化为的动态规划:
前两次比较容易看出来:return number
if number>2:
res=[1,2]
for i in range(2,number):
res_s=res[i-1]+res[i-2]
res.append(res_s)
return res[number-1]
斐波那契转化为的动态规划:
前两次比较容易看出来:return number
if number>2:
res=[1,2]
for i in range(2,number):
res_s=res[i-1]+res[i-2]
res.append(res_s)
return res[number-1]