ACM_lowbit】的更多相关文章

lowbit Time Limit: 2000/1000ms (Java/Others) Problem Description: long long ans = 0; for(int i = 1; i < = n; i ++) ans += lowbit(i) lowbit(i)的意思是将i转化成二进制数之后,只保留最低位的1及其后面的0,截断前面的内容,然后再转成10进制数 比如lowbit(7),7的二进制位是111,lowbit(7) = 1,6 = 110(2),lowbit(6) =…