码迷,mamicode.com
首页 >  
搜索关键字:pow    ( 2646个结果
Python基础教程笔记——第1章
1.8 函数 pow(x,y) x^y abs(x) 取数的绝对值 round(x) 会把浮点数四舍五入为最接近的整数 floor(x) 向下取整的函数,但是需要先import math模块1.9 模块 用import导入模块来扩展Python的功能 (1)im...
分类:编程语言   时间:2015-08-01 09:58:18    阅读次数:135
hdu 5297 Y sequence(容斥)
题目链接:hdu 5297 Y sequence 考虑62以内的指数,x为奇数个质数因子,就减掉,偶数个加上。计算x为指数的不满足数直接pow(n,1/x)即可。 #include #include #include #include #include #include using namespace std; typedef long long ll; cons...
分类:其他好文   时间:2015-07-31 23:37:34    阅读次数:127
【leetcode】Pow(x,n)
马上各种校招要开始了,怎么也得准备一下,之前一直在看看机器学习,NLP方面的东西,收获很多。最近换换脑子,回过头来做做leetcode,感觉还是蛮有意思的。今天刷了个水题,AC不高,然而难度也不高。。不知道为啥。第一次提交用了最最锉的方法,找虐的,很明显超时。于是开始想,第一个想到的就是二分,本.....
分类:其他好文   时间:2015-07-28 22:35:43    阅读次数:109
【LeetCode-面试算法经典-Java实现】【050-Implement pow(x, n)(求x的n次方)】
【050-Implement pow(x, n)(求x的n次方)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题  Implement pow(x, n). 题目大意 求x的n次方。  解题思路  递归求解。 代码实现算法实现类public class Solution { public double myPow(double x, int n) {...
分类:编程语言   时间:2015-07-28 06:43:24    阅读次数:166
Python导入模块的三种形式
Python导入模块的3中方式:1、import module_name这样在程序里就可以通过module_name.metnod_name()的方式访问模块里的函数了Example:>>>import math>>> math.sqrt(5)2.23606797749979>>> math.pow...
分类:编程语言   时间:2015-07-25 21:25:39    阅读次数:161
uva712_S树
题解: 把查询的值看成二进制,转换成十进制之后去叶子里面找对应的值输出即可#include #include #includeconst int N = 100009;int change(char * s); //pow调用库中的也可,由于可能存在的精度问题,重写了一下 int pow(int x, int y); void rev(char...
分类:其他好文   时间:2015-07-24 22:43:13    阅读次数:266
棋盘覆盖(大数阶乘,大数相除)
棋盘覆盖时间限制:3000 ms | 内存限制:65535 KB难度:3描述在一个2k×2k(1#include#define MAXN 10010int m[MAXN],pow[MAXN];void bigpower(int n){int a,b;memset(m,0,sizeof(m));m[0...
分类:其他好文   时间:2015-07-24 22:29:53    阅读次数:132
HDU 1047 Integer Inquiry
Integer InquiryProblem DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of pow...
分类:其他好文   时间:2015-07-24 20:10:11    阅读次数:97
LeetCode(50) Pow(x, n)
处理数值计算问题的两种方法:1、基于分治法的二进制分解的方法;2、基于减二法的二分法。参考Code Ganker。基于分治法的二进制分解的方法class Solution { public: double myPow(double x, int n) { bool isNegative = false; if(n % 2 == 1 && x < 0)...
分类:其他好文   时间:2015-07-24 16:09:09    阅读次数:90
Lucas求大数组合数模板
void init(){ int i; fac[0] =1; for(i =1; i >=1; } return ans;}llg C(llg n, llg m){ if(m > n) return0; return fac[n]*pow(fac[m]...
分类:编程语言   时间:2015-07-23 17:05:46    阅读次数:93
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!