码迷,mamicode.com
首页 >  
搜索关键字:reversible primes    ( 347个结果
* SPOJ PGCD Primes in GCD Table (需要自己推线性筛函数,好题)
题目大意:给定n,m,求有多少组(a,b) 0g(p'x)=mu[x]2.x%p'!=0 , 那么对于先前所有的 x/p 来说,此时乘了p' , 若p!=p' , 那么因为多了一个因子 mu[p'*x/p] = -mu[x/p] , 所以在p!=p'时,所有的情况相加为-g(x),在考虑枚举到的p'...
分类:其他好文   时间:2015-04-14 23:13:17    阅读次数:231
Sicily 14256. Pseudo Semiprime
14256. Pseudo Semiprime Constraints Time Limit: 1 secs, Memory Limit: 256 MB Description In number theory, a positive integer is a semiprime if it is the product of two primes. For example, 35 i...
分类:其他好文   时间:2015-04-08 09:13:44    阅读次数:108
uva 11762
#include #include #include #include using namespace std; #define MAX 1000010 #define MAXP 700000 int vis[MAX]; int prime[MAXP]; int n; double dp[MAX]; bool flag[MAX]; int primes_num; void sieve...
分类:其他好文   时间:2015-03-21 20:05:32    阅读次数:134
10375 - Choose and divide
#include using namespace std; const int maxn = 10000 + 5; int e[maxn],vis[maxn]; vector primes; void add_primes() { memset(vis,0,sizeof(vis)); int m = sqrt(10000+0.5); for(int i=2;i<=m;i++...
分类:其他好文   时间:2015-03-19 18:30:44    阅读次数:164
hdu 2161 Primes 筛法求素数 大水题
Problem Description Write a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2 are not considered primes. Input Each inp...
分类:其他好文   时间:2015-03-13 14:24:56    阅读次数:130
求给定数目的前 n 个素数
bool is_prime (const vector& primes, int num){ for (const auto& prime : primes) { if (num % prime == 0) { return false; } ...
分类:其他好文   时间:2015-03-10 13:26:31    阅读次数:103
PAT:1015. Reversible Primes (20) AC
#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
Power of Cryptography
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
1015. Reversible Primes
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-28 21:46:29    阅读次数:187
1015. Reversible Primes (20)
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
347条   上一页 1 ... 28 29 30 31 32 ... 35 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!