1. 问题描述 Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the ...
分类:
其他好文 时间:
2016-07-03 23:24:25
阅读次数:
131
给定一个整数,求出它的二进制表达形式含有多少个1 例如 11(00000000000000000000000000001011) 则返回3 这里学到一个bit操作的办法。 就是如果你想知道某个数某一位的二进制表达是多少,你可以 n>>k n&1 先将n右移,然后和1与。 也可以 m=1<<k n&m ...
分类:
其他好文 时间:
2016-07-01 18:14:22
阅读次数:
119
找每个位置循环节的大小。 得到结果d1, d2, ....., dn。 最终结果cmd(d1, d2, ...., dn)。 水题。 题目链接: http://hihocoder.com/contest/hihointerview11/problem/1 代码: 1 #include <bits/s ...
分类:
编程语言 时间:
2016-07-01 01:16:58
阅读次数:
192
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 and r ...
分类:
其他好文 时间:
2016-06-30 14:28:35
阅读次数:
146
..k次最短路后,考虑如何满足先走一些点 用状压dp,每一个点考虑它所需要经过的点a[i],当当前走过的点包含a[i]时,i 这个点才可以到达。 写的时候用记忆化搜索。 1 #include<bits/stdc++.h> 2 #define ll long long 3 using namespac ...
分类:
其他好文 时间:
2016-06-27 15:29:19
阅读次数:
146
从问题可以看出是求补图的连通块及点数 但补图太大。所以考虑缩小规模。 当一个点归属于一个连通块后,它以后就不需要了。所以可以用链表,删去这个点,也就减小了规模。 一个点开始bfs,每个点只会进队一次,就被删除了,但是具体的时间复杂度不好估计。。 1 #include<bits/stdc++.h> 2 ...
分类:
其他好文 时间:
2016-06-27 15:20:53
阅读次数:
193
操作系统:CentOS6.4GlusterFS:3.4.2测试工具:atop,iperf,iozone,fio,postmark配置规划下载并安装1、下载地址:http://bits.gluster.org/pub/gluster/glusterfs/3.4.2/x86_64/需要下载的rpm包2、RPM安装包glusterfs-3.4.2-1.el6.x86_64.rpmglusterfs-api-3.4.2-1.el6.x86_64.rp..
分类:
其他好文 时间:
2016-06-27 00:06:56
阅读次数:
683
STL内部实现的rbtree,实现 lower_bound/upper_bound 过程,是从 begin() 开始向 end() 进行遍历,将元素的 key 与目标 key 进行比较,直至找到的第一个符合要求的 iterator 为止!具体看代码,如下 位于bits/stl_tree.h ...
分类:
其他好文 时间:
2016-06-26 11:32:44
阅读次数:
157
补一发题解。。 整体二分这个东西,一开始感觉复杂度不是很靠谱的样子 问了po姐姐,说套主定理硬干。。 1 #include<bits/stdc++.h> 2 #define ll long long 3 #define inf 1e9 4 #define N 300005 5 using names ...
分类:
其他好文 时间:
2016-06-25 19:08:25
阅读次数:
182
windows 10 64 bits matlab 2015b/2016a MatConvNet 1.0-beta20 或者从github 下载GIT repository CUDA GPU Computing ToolKit 7.5 cudnn-rc4/cudnn-rc5 都按照官网http:// ...
分类:
Windows程序 时间:
2016-06-24 19:03:32
阅读次数:
3282