码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
1001 A+B Format
1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (un ...
分类:其他好文   时间:2019-02-19 13:53:16    阅读次数:210
Prime Distance POJ - 2689 线性筛
一个数 $n$ 必有一个不超过 $\sqrt n$ 的质因子。 打表处理出 $1$ 到 $\sqrt n$ 的质因子后去筛掉属于 $L$ 到 $R$ 区间的素数即可。 Code: ...
分类:其他好文   时间:2019-02-18 12:54:43    阅读次数:176
338. Counting Bits
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 ...
分类:其他好文   时间:2019-02-16 21:59:04    阅读次数:176
PAT A1015 Reversible Primes (20 分)
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:其他好文   时间:2019-02-15 19:50:49    阅读次数:190
POJ2689 ZOJ1842 UVA10140 Prime Distance【筛选法】
"Prime Distance" Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25099 Accepted: 6567 Description The branch of mathematics called number t ...
分类:其他好文   时间:2019-02-13 00:25:11    阅读次数:153
最小生成树与最短路径--C语言实现
接昨天,在这里给出图的其中一种应用:最小生成树算法(Prime算法和Kruskal算法)。两种算法的区别就是:Prime算法以顶点为主线,适合用于顶点少,边密集的图结构;Kruskal算法以边为主线,适合于顶点比较多,但是边比较稀疏的图结构。代码如下,亲测,可执行,在最后也给出输入数据的形式。 本来 ...
分类:编程语言   时间:2019-02-12 18:45:52    阅读次数:190
UVA10789 Prime Frequency【筛选法】
Given a string containing only alpha numerals (0 9, A Z and a z) you have to count the frequency (the number of times the character is present) of all ...
分类:其他好文   时间:2019-02-12 18:45:36    阅读次数:236
[POJ1811]Prime Test
题目:Prime Test 传送门:http://poj.org/problem?id=1811 分析: miller-Rabin测试和Pollard-rho算法 的裸题啦 abs关于longlong 自动进行了类型强制转换,Wa了一万发。 ...
分类:其他好文   时间:2019-02-12 01:37:28    阅读次数:156
生成函数(母函数)总结
生成函数(母函数)总结 普通型生成函数($OGF$) 定义 对于一个序列$a_0,a_1,a_2,a_3...$,定义$G(x)=a_0+a_1x^1+a_2x^2+a_3x^3+...$为序列的母函数。 然后。。。没了???没了。 应用 一些常见的生成函数($n\in N^+$): $\frac ...
分类:其他好文   时间:2019-02-10 20:42:52    阅读次数:203
HDU 4135 Co-prime (容斥+分解质因子)
<题目链接> 题目大意: 给定区间[A,B](1 <= A <= B <= 10 15)和N(1 <=N <= 10 9),求出该区间中与N互质的数的个数。 解题分析: 将求区间[A,B]与N互质的数转化成求[1,B] 区间与N互质的个数 - [1,A-1]中与N互质的个数。同时,因为直接求区间内与 ...
分类:其他好文   时间:2019-02-09 19:27:32    阅读次数:165
3428条   上一页 1 ... 45 46 47 48 49 ... 343 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!