![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
Master_miao
这个作者很懒,什么都没留下…
展开
-
统计一个非负整数的二进制形式中1的个数
统计一个非负整数的二进制形式中1的个数int CountBit(int x){ int ret = 0; while(x){ ret++; x &= x-1; // 等价于 x = x & (x-1) } return ret;}原理: 把一个整数减去1,再和原整数做与运算,会把该整数最右边一个1变成0。...原创 2021-05-21 15:56:01 · 2800 阅读 · 0 评论 -
数字金字塔(动态规划)【详】
详解数字金字塔(动态规划)原创 2021-03-08 15:33:11 · 1126 阅读 · 0 评论 -
2021-03-07
转:动态规划——01背包问题(侵必删)https://www.cnblogs.com/kkbill/p/12081172.html转载 2021-03-07 16:25:50 · 70 阅读 · 0 评论