首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
fibinary专题
UVA - 763 Fibinary Numbers
题意: 将用斐波那切表示的二进制相加,题目说可能一个数可以有几种不同的表示形式,那么要求不存在两个相邻的1,至于二进制相加的时候有几个注意的地方,就是当ans[i]>=1的时候,如果ans[i-1]>=1的话,那么利用斐波那切的公式ans[i]=ans[i-1]+ans[i-2] 处理使得不存在相邻的两个1,还有的就是当ans[i]>=2的时候,利用ans[i+1]=ans[i]+ans[i-1
阅读更多...
uva 763 Fibinary Numbers
原题: The standard interpretation of the binary number 1010 is 8 + 2 = 10. An alternate way to view the sequence “1010” is to use Fibonacci numbers as bases instead of powers of two. For this problem,
阅读更多...