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
一个数 $n$ 必有一个不超过 $\sqrt n$ 的质因子。 打表处理出 $1$ 到 $\sqrt n$ 的质因子后去筛掉属于 $L$ 到 $R$ 区间的素数即可。 Code: ...
分类:
其他好文 时间:
2019-02-18 12:54:43
阅读次数:
176
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
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
"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
接昨天,在这里给出图的其中一种应用:最小生成树算法(Prime算法和Kruskal算法)。两种算法的区别就是:Prime算法以顶点为主线,适合用于顶点少,边密集的图结构;Kruskal算法以边为主线,适合于顶点比较多,但是边比较稀疏的图结构。代码如下,亲测,可执行,在最后也给出输入数据的形式。 本来 ...
分类:
编程语言 时间:
2019-02-12 18:45:52
阅读次数:
190
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
题目: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
<题目链接> 题目大意: 给定区间[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