题目:Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 913 Accepted Submission(s): 492 Problem DescriptionA number whose only prime facto...
分类:
其他好文 时间:
2015-02-10 21:47:04
阅读次数:
250
解题思路:
先用BFS预处理出每个字母节点到其它节点的最短路径,然后套用prime算法。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
using namespace std;
const int ...
分类:
其他好文 时间:
2015-02-09 16:06:27
阅读次数:
181
时间限制50 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者HE, QinmingGiven any positive integer N, you are supposed to find all of its prime factors, and write ...
分类:
其他好文 时间:
2015-02-08 00:17:46
阅读次数:
186
??
练习1.33
题目第二行描述,只组合起由给定范围得到的项里的那些满足特定条件的项,因此我们需要在这一版本的accumulate中添加一个need-filter?,这个新的谓词可以用来传递下面就要用到的prime?。
(define (filtered-accumulateneed-filter? combiner null-value term a next b)
(...
分类:
其他好文 时间:
2015-02-07 11:50:50
阅读次数:
121
Ugly NumbersUgly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the first 11 ugl...
分类:
其他好文 时间:
2015-02-06 12:48:40
阅读次数:
217
Description描述Nearly prime number is an integer positive number for which it is possible to find such primesP1andP2that given number is equal toP1*P2. ...
分类:
其他好文 时间:
2015-02-05 14:53:15
阅读次数:
171
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define MAX 65535 9 int prime[MAX+5];10 bool vis[MAX+5];11....
分类:
其他好文 时间:
2015-02-03 22:45:59
阅读次数:
197
欧拉函数/莫比乌斯函数 嗯……跟2910很像的一道题,在上道题的基础上我们很容易就想到先求出gcd(x,y)==1的组,然后再让x*=prime[i],y*=prime[i]这样它们的最大公约数就是prime[i]了…… 当然我们完全没必要这样做……对于每个prime[j],计算在(1,n/pr.....
分类:
其他好文 时间:
2015-02-03 19:12:36
阅读次数:
215
题意:S[n]与所有S[i](i互质,则为Prime S。求(S[n]/X)%M;
思路:由集合性质推得S[i+1]=S[i]+S[i-1],则S[i]是斐波那契数。从第五项开始,每项斐波那契为质数的条件为当且仅当它的项数为质数,因此采用素数打表的方法得到第k个Prime S的斐波那契数的项数。然后用矩阵乘法求出第k个S的值对应的下一个斐波那契数,然后枚举该斐波那契数,直到能被X整除。
#in...
分类:
其他好文 时间:
2015-02-03 13:20:17
阅读次数:
150
Sum of Consecutive Prime NumbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 20050Accepted: 10989DescriptionSome positive integers can be ...
分类:
其他好文 时间:
2015-02-02 22:45:31
阅读次数:
164