码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
PAT 1078 Hashing
# include # include # include # include # include using namespace std; int prime[10100]; int vis[10110]; int cot; void init_prime() { memset(vis,0,sizeof(vis)); cot=0; for(int i=2; i<...
分类:其他好文   时间:2014-11-26 22:39:32    阅读次数:218
Prime算法求最小生成树 (邻接表)
实现了 Prime算法求最小生成树 (邻接表)的普通算法和最小堆优化算法。...
分类:编程语言   时间:2014-11-26 21:02:49    阅读次数:663
HDU 4135-Co-prime(容斥原理)
题目链接:传送门 题意:求区间[a,b]内与n互质的数的个数。 思路:用容斥求出[1-b]与n互质的个数—[1-(a-1)]内与n互质的个数。  #include #include #include #include #include #include #include #include #include #include #include #include #inc...
分类:其他好文   时间:2014-11-26 20:59:27    阅读次数:180
[4Clojure]解题记录-#67
Difficulty:MediumTopics:primesWrite a function which returns the first x number of prime numbers.(= (__ 2) [2 3])(= (__ 5) [2 3 5 7 11])(= (last (__ 1...
分类:其他好文   时间:2014-11-26 20:51:36    阅读次数:144
二分快速幂 [FOJ ] 1752
Problem 1752 A^B mod CAccept: 750Submit: 3205Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionGiven A,B,C, You should quickly calculate ...
分类:其他好文   时间:2014-11-26 15:58:42    阅读次数:217
Prime算法求最小生成树 (邻接矩阵)
实现了 Prime算法求最小生成树 (邻接矩阵)的普通算法和最小堆优化算法。...
分类:编程语言   时间:2014-11-26 14:20:25    阅读次数:342
USACO 1.3 Prime Cryptarithm (枚举)
描述 下面是一个乘法竖式,如果用我们给定的那n个数字来取代*,可以使式子成立的话,我们就叫这个式子牛式。 *** x ** ---------- *** *** ---------- **** 数字只能取代*,当然第一位不能为0,况且给定的数字里不包括0。 注意一下在...
分类:其他好文   时间:2014-11-26 14:18:26    阅读次数:164
sgu113
SGU113 Nearly Prime Numbers 题目大意: 求一个数N是否能由两个质数p1*p2得到(p1可以=p2) 输入: 数据组数Q(1 Q个数,为题目要求的数字N(1 输出: 对于每个数字,如果找得到,则输出"Yes",否则输出"No",用回车隔开。 样例输入: 1 6 样例输出: Yes 看似比较水的一道题目(实际也比较水)。 首先我们不妨设p...
分类:其他好文   时间:2014-11-26 11:33:41    阅读次数:175
USACO6.4-The Primes
The PrimesIOI'94In the square below, each row, each column and the two diagonals canbe read as a five digit prime number. The rows are read from lef.....
分类:其他好文   时间:2014-11-25 23:18:19    阅读次数:199
HUD 3706 单调队列简单题
Problem Description Give you three integers n, A and B.  Then we define Si = Ai mod B and Ti = Min{ Sk | i-A = 1} Your task is to calculate the product of Ti (1      不描述题意了,三行英文挺明了的,今天刚学单调队列...
分类:其他好文   时间:2014-11-24 22:35:31    阅读次数:262
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!