#include#include#includeusing namespace std;int D[111]; //存放拆解的数字int DI=0; //D的数组下标bool isPrime(int n){ if(n<=1) return 0; int ...
分类:
其他好文 时间:
2015-03-06 12:23:02
阅读次数:
130
DescriptionCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in ...
分类:
其他好文 时间:
2015-03-04 14:19:10
阅读次数:
135
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 reversible prime because its reverse 37 is also a pr...
分类:
其他好文 时间:
2015-02-25 21:10:58
阅读次数:
151
传送门:Primes in GCD Table题意:给定两个数和,其中,,求为质数的有多少对?其中和的范围是。分析:这题不能枚举质数来进行莫比乌斯反演,得预处理出∑υ(n/p)(n%p==0).#pragma comment(linker,"/STACK:1024000000,1024000000"...
分类:
其他好文 时间:
2015-02-21 01:22:36
阅读次数:
252
Areversibleprimeinanynumbersystemisaprimewhose"reverse"inthatnumbersystemisalsoaprime.Forexampleinthedecimalsystem73isareversibleprimebecauseitsrevers...
分类:
其他好文 时间:
2015-01-30 07:52:34
阅读次数:
145
HDU 5104 Primes Problem(数学)...
分类:
其他好文 时间:
2015-01-25 11:13:01
阅读次数:
170
http://acm.hdu.edu.cn/showproblem.php?pid=5104#include#include#include#include#includeusing namespace std;int isp[10000+100];int prime[10000];int coun...
分类:
其他好文 时间:
2015-01-18 15:42:54
阅读次数:
161
题意:选择K个质数使它们的和为N,求总的方案数。分析:虽然知道推出来了转移方程, 但还是没把代码敲出来,可能基本功还是不够吧。d(i, j)表示i个素数的和为j的方案数,则 d(i, j) = sigma d(i-1, j-p[k]) ,其中p[k]表示第k个素数注意递推的顺序是倒着推的,否则会计算...
分类:
其他好文 时间:
2015-01-05 21:46:55
阅读次数:
223
newLISP实现了Cilk API, 可以将多个同时运行的进程执行在多处理器或者多核的CPU架构上,已达到并行节省运行时间的目的。使用spawn和sync函数可以很快的实现。下面是来自newLISP官方文档的例子:#!/usr/bin/newlisp
; calculate primes in a range
(define (primes from to)
(local (plist)...
分类:
系统相关 时间:
2014-12-20 14:17:19
阅读次数:
207
此题首先为利用筛选法求得10000以内的素数,然后对于输入的每一个数字,依次以小于它的连续素数相加,相等则种类数加一,返回,换另一个素数开始往后继续相加进行这个过程,最后输出种类数。1259. Sum of Consecutive PrimesConstraintsTime Limit: 1 sec...
分类:
其他好文 时间:
2014-12-08 21:18:22
阅读次数:
228