package
Version:
v0.0.0-...-4302f07
Opens a new window with list of versions in this module.
Published: Jul 10, 2019
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
以二进制的角度看,偶数/2相当于消掉末尾的0,奇数+-1相当于将末尾的1变0,同时+1会产生进位。
相当于将二进制数不断消去末尾只剩1的最少步数。
对于末尾0来说,直接消去,只用1步
对于末尾1来说,需要先变成0再消去,需要2步
而+1产生的进位会使得前面的若干位反转,显然1反转成0的步数会比0反转成1更优
所以只需判断倒数第二位是否为1
注意3(11)这个特殊情况
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.