HDOJ:2161 1 #include 2 #include 3 const int MAXN = 16100; 4 bool prime[MAXN]; 5 void init(){ 6 memset(prime,true,sizeof(pr...
分类:
其他好文 时间:
2016-01-10 20:02:12
阅读次数:
229
第一种方法TheSieve of Eratosthenesis one of the most efficient ways to find all prime numbers up ton.The Sieve of Eratosthenes uses an extra O(n) memory an...
分类:
其他好文 时间:
2016-01-10 14:17:47
阅读次数:
118
Description给定整数N,求1b,并减去(1,1)之类的值) 1 #include 2 const int maxn=10000010; 3 bool pd[maxn]; 4 long long phi[maxn],prime[maxn],top,n,ans; 5 void ES(){ 6 ...
分类:
其他好文 时间:
2016-01-09 13:48:42
阅读次数:
118
D.引水工程Time Limit:2 SecMemory Limit:128 MB Submit:118Solved:41 [Submit][Status][Web Board]Description南水北调工程是优化水资源配置、促进区域协调发展的基础性工程,是新中国成立以来投资额最大、涉及面最广的...
分类:
其他好文 时间:
2016-01-02 14:17:45
阅读次数:
283
Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes o...
分类:
其他好文 时间:
2016-01-01 09:23:02
阅读次数:
180
关于 caesum.com 网上上的题目,分类有Sokoban,Ciphers,Maths,Executables,Programming,Steganography,Misc。题目有点难度,在努力奋战中……problem 21 Factorwhat is the largest prime fac...
分类:
其他好文 时间:
2016-01-01 00:27:42
阅读次数:
238
质因数分解(prime.cpp/c/pas)【问题描述】已知正整数n是两个不同的质数的乘积,试求出较大的那个质数。【输入】输入文件名为prime.in。输入只有一行,包含一个正整数n。【输出】输出文件名为prime.out。输出只有一行,包含一个正整数p,即较大的那个质数。【数据范围】对于60%的数...
分类:
其他好文 时间:
2015-12-31 08:48:22
阅读次数:
181
Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creat...
分类:
其他好文 时间:
2015-12-30 11:12:34
阅读次数:
143
题目描述:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For ...
分类:
编程语言 时间:
2015-12-28 15:43:06
阅读次数:
200
The number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as backward). Write a...
分类:
其他好文 时间:
2015-12-26 14:50:19
阅读次数:
198