码迷,mamicode.com
首页 >  
搜索关键字:implement pow    ( 4537个结果
[Leetcode][JAVA] LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:编程语言   时间:2014-10-01 02:29:00    阅读次数:222
POJ 1046 Color Me Less 最详细的解题报告
题目来源:POJ 1046 Color Me Less题目大意:每一个颜色由R、G、B三部分组成,D=Math.sqrt(Math.pow((left.red - right.red), 2)+ Math.pow((left.green - right.green), 2)+ Math.pow((l...
分类:其他好文   时间:2014-09-30 02:39:52    阅读次数:339
类与结构体比较
//结构示例:public struct Person{ string Name; int height; int weight}public bool overWeight(){ //implement something} 类示例: public class Test...
分类:其他好文   时间:2014-09-29 21:44:21    阅读次数:167
X的N次方求解——pow(x,n)实现
最近看到这样的一个题目求X的N次方,自己想了一些解决办法,记录一下留作日后参考...
分类:其他好文   时间:2014-09-29 19:34:01    阅读次数:129
Lucas定理及其应用
Lucas定理这里有详细的证明。其实就是针对n, m很大时,要求组合数C(n, m) % p, 一般来说如果p 2 #include 3 #include 4 using namespace std; 5 6 #define N 100010 7 8 long long mod_pow(i...
分类:其他好文   时间:2014-09-28 22:10:55    阅读次数:192
HDU 3037 Saving Beans 大组合数 lucas定理
直接lucas降到10w以内搞组合数 #include #include typedef __int64 LL; LL f[110010]; LL pow(LL a, LL b, LL c) { LL ans = 1; while(b) { if(b&1) ans = (ans*a) % c; b >>= 1; a = (a*a) % c; } return an...
分类:其他好文   时间:2014-09-28 21:49:55    阅读次数:216
Arrays.sort()
今天在做一个按更新时间搜寻出某个目录里面的全部文件,因为自己写算法比較花费时间,干脆就用j2se提供的类Arrays提供的sort()方法,这样就比較省力。对于基本数据类型仅仅要Arrays.sort(数组)[“注:数组是声明为基本数据类型的数组,如int[]等”]对于对象类型,要implement...
分类:其他好文   时间:2014-09-28 21:13:45    阅读次数:152
[JAVA]各种杂七杂八的东西......
BigInteger / BigDecimal / string 一些常用的函数:加 add减 substract乘 multiply除 divid取余 mod次幂 pow(int)比较 compareTo / equals判断是否某string开头(是否0开头) startsWith("0").....
分类:编程语言   时间:2014-09-28 00:18:50    阅读次数:323
Deleting comments in c or java code by awk scripts
Last night , I attended writting examination for Bai Du,There is a problem, ask us implement a state machine to deleting the comments in c,I don't k.....
分类:编程语言   时间:2014-09-27 10:43:39    阅读次数:178
[LeetCode]Pow(x, n)
Implement pow(x, n). public class Solution { public double pow(double x, int n) { if(n>0) return powInt(x,n); else return 1/powInt(x,-n); } private double powInt(double x, int n){ if...
分类:其他好文   时间:2014-09-26 20:00:48    阅读次数:112
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!