码迷,mamicode.com
首页 >  
搜索关键字:bits    ( 3873个结果
[LeetCode] Serialize and Deserialize BST 二叉搜索树的序列化和去序列化
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or ...
分类:其他好文   时间:2016-12-27 07:50:21    阅读次数:501
338. Counting Bits
https://leetcode.com/problems/counting-bits/ 给定一个非负数n,输出[0,n]区间内所有数的二进制形式中含1的个数 Example: For num = 5 you should return [0,1,1,2,1,2]. 注意fellow up部分,题目 ...
分类:其他好文   时间:2016-12-26 14:03:32    阅读次数:159
[LeetCode] Hamming Distance 汉明距离
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul ...
分类:其他好文   时间:2016-12-20 07:34:37    阅读次数:241
Codeforces Round #382 (Div. 2)
A. Ostap and Grasshopper(water) 题意: 给出一个字符串(n<=100),问从‘G’字符的位置可否每次只可恰好跳步长为k的一步(只可跳到非‘#’字符的位置且不可跳出字符串外),跳若干步到达‘T’字符的位置。 1 #include <bits/stdc++.h> 2 us ...
分类:其他好文   时间:2016-12-16 22:00:41    阅读次数:261
Leetcode: Plus One Linked List
Use Stack, O(N) space Two Pointers, O(1) space i stand for the right-most non-9 bit, where if there's a carry, i is incremented and the bits after i w ...
分类:其他好文   时间:2016-12-16 14:53:25    阅读次数:149
Leetcode-190 Reverse Bits
#190. Reverse Bits Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 000000101001010000011 ...
分类:其他好文   时间:2016-12-16 07:40:59    阅读次数:189
Codeforces Round #384 (Div. 2)
A. Vladik and flights(water) 题意:从a位置到b位置去, 问最短花费 想通了就是大水题 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int INF = 0x3f3f3f3f; 4 const int ...
分类:其他好文   时间:2016-12-15 14:15:39    阅读次数:196
leetcode刷题全纪录(持续更新)
338. Counting Bits 原题链接https://leetcode.com/problems/counting-bits/ 自己的思路:Integer.bitCount()方法,但是原题并不推荐使用内嵌方法 bug free:遇到偶数时,其1的个数和该偶数除以2得到的数字的1的个数相同, ...
分类:其他好文   时间:2016-12-14 22:07:38    阅读次数:189
LeetCode191 Number of 1 Bits. LeetCode231 Power of Two. LeetCode342 Power of Four
位运算相关 三道题 231. Power of Two 位运算相关 三道题 231. Power of Two Given an integer, write a function to determine if it is a power of two. (Easy) 分析: 数字相关题有的可以考 ...
分类:其他好文   时间:2016-12-12 22:52:53    阅读次数:154
256 terabytes random-access memory
Computer Systems A Programmer's Perspective Second Edition As we will discuss, the extension of IA32 to 64 bits, termed x86-64, was origi- nally devel ...
分类:数据库   时间:2016-12-05 14:21:39    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!