码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
leetcode 338. Counting Bits
题目: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation a ...
分类:其他好文   时间:2016-04-20 17:51:22    阅读次数:115
python1
leetcode上面的很简单的题目 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given ...
分类:编程语言   时间:2016-04-18 22:17:31    阅读次数:139
debug
/* debug masks (32 bits, non-overlapping) */#define D_BUG 0x00000001#define D_INFO 0x00000002#define D_WARNING 0x00000004#define D_ERROR 0x00000008#de ...
分类:其他好文   时间:2016-04-18 19:03:03    阅读次数:153
[LeetCode] Power of Four 判断4的次方数
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num = 5, return f ...
分类:其他好文   时间:2016-04-18 13:29:50    阅读次数:201
342. Power of Four(One-line)
342. Power of Four Total Accepted: 707 Total Submissions: 2005 Difficulty: Easy Given an integer (signed 32 bits), write a function to check whether i ...
分类:其他好文   时间:2016-04-18 13:16:59    阅读次数:156
leetcode 上的Counting Bits 总结
最近准备刷 leetcode 做到了一个关于位运算的题记下方法 int cunt = 0; while(temp) { temp = temp&(temp - 1); //把二进制最左边那个1变为零 count++; //统计1的个数 } 同理把位二进制坐左边那个0变为1 就可以 temp = te ...
分类:其他好文   时间:2016-04-17 20:33:38    阅读次数:116
190. Reverse Bits Java Solutin
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur ...
分类:编程语言   时间:2016-04-15 21:35:57    阅读次数:196
线段树成段更新模板POJ3468 zkw以及lazy思想
别人跑几百毫秒 我跑 2500多 1 #include<cstdio> 2 #include<map> 3 //#include<bits/stdc++.h> 4 #include<vector> 5 #include<stack> 6 #include<iostream> 7 #include<a ...
分类:其他好文   时间:2016-04-15 21:30:46    阅读次数:238
LeetCode 338. Counting Bits
题目: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation a ...
分类:其他好文   时间:2016-04-14 20:57:58    阅读次数:154
CQOI 2016 k远点对
题目大意:n个点,求第k远的点对的距离 KD树裸题 注意要用堆维护第k远 #include<bits/stdc++.h> #define ll unsigned long long #define maxn 100010 using namespace std; inline int read(){ ...
分类:其他好文   时间:2016-04-12 12:58:25    阅读次数:403
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!