Prime power triplesThe smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly ...
分类:
其他好文 时间:
2015-11-27 21:37:09
阅读次数:
201
题目:Given an integer, write a function to determine if it is a power of two.链接:http://leetcode.com/problems/power-of-two/题解:验证一个数是否是2的幂次,我们可以使用(n & (n ...
分类:
其他好文 时间:
2015-11-27 12:58:08
阅读次数:
123
public class Solution { public boolean isPowerOfTwo(int n) { int tmp = 1; for (int j = 0; j n) { return false; ...
分类:
其他好文 时间:
2015-11-27 06:45:05
阅读次数:
117
今天看到了一个非常好的算法,数学什么什么定理我不懂,但这算法值得我学习。目的:计算n的m次方int power(int n,int m){ int odd=1;//用来把剩下的数乘进去 while(p>1){ if((m & 1) != 0)odd*=n; else n*=n; ...
分类:
编程语言 时间:
2015-11-26 23:25:48
阅读次数:
316
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3916复习一下hash(然后被傻叉错误卡了半天TAT。。。取出一个字串:h[r]-h[l-1]*power[r-l+1] 然后匹配。。。注意一下当前需要的是s[i]还是s[i-1],做hash数组...
分类:
其他好文 时间:
2015-11-26 22:53:42
阅读次数:
199
概述Docs:http://docs.ceph.com/docsCeph是一个分布式文件系统,在维持POSIX兼容性的同时加入了复制和容错功能。Ceph最大的特点是分布式的元数据服务器,通过CRUSH(ControlledReplicationUnderScalableHashing)这种拟算法来分配文件的location。Ceph的核心是RADOS(ReliableA..
分类:
其他好文 时间:
2015-11-26 01:30:54
阅读次数:
254
n & (n - 1)的作用:把n中为1的最低位变为0.Power of TwoGiven an integer, write a function to determine if it is a power of two.解法:2的次幂的特征是有且仅有一位为1,其余为均为零。故可利用判断n & (...
分类:
其他好文 时间:
2015-11-24 12:56:34
阅读次数:
99
--数学函数 --ABS绝对值,select ABS(-99)--ceiling取上限,select CEILING(4.5)--floor去下限select FLOOR(4.5)--power 几次方,select POWER(2,2)--round四舍五入,select round (6.45....
分类:
数据库 时间:
2015-11-20 22:57:09
阅读次数:
222
转自:http://blog.chinaunix.net/uid-24517893-id-254740.htmlLinux Power Managment谨以此文纪念过往的岁月一.前言在这个对节能要求越来越严格的年代,对设备的电源管理就显的很重要的了,尤其对于可移动设备,在电源有限的情况下,续航能力...
分类:
系统相关 时间:
2015-11-20 20:03:41
阅读次数:
235
有n(n#include using namespace std;const int N = 11;const int MAXN = 1 > n && n) { for (int i = 0; i > power[i][j]; } } ...
分类:
其他好文 时间:
2015-11-20 20:01:09
阅读次数:
162