码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
PAT B1013
PAT B1013 标签(空格分隔): PAT 解法 :埃氏筛法 注意点: 1. 由于不知道第n个素数有多大,所以要用一个大的数组来储存结果。 2. 注意输出格式,末尾不能有多余空格 include const int maxn = 1000001; int prime[maxn], num = 0 ...
分类:其他好文   时间:2019-02-07 12:13:50    阅读次数:168
poj2109 【贪心】
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area h ...
分类:其他好文   时间:2019-02-07 10:50:51    阅读次数:129
Spring 2019 HW1 MAT 331
Spring 2019 HW1 MAT 331Homework 1: MAT 331Due: 11:59pm, Feb 5, 2019Collaboration policy: You are welcome to work with others on this homework assignme ...
分类:编程语言   时间:2019-02-06 19:58:37    阅读次数:107
欧拉筛打素数表
1 #define MAXN 100000 2 int prime[MAXN],vis[MAXN]; 3 int db(int n) 4 { 5 int i,j; 6 int k=0; 7 for(i=2; in) break; 13 vis[prime[j]*i]=1; 14 if(i%prime... ...
分类:其他好文   时间:2019-02-05 13:07:39    阅读次数:157
HDU4746 Mophues
题目地址 "题目链接" Description As we know, any positive integer C ( C = 2 ) can be written as the multiply of some prime numbers: C = p1×p2× p3× ... × pk whi ...
分类:其他好文   时间:2019-02-03 23:38:42    阅读次数:214
1081 Rational Sum (20 分)分数加法
1081 Rational Sum (20 分) Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Eac ...
分类:其他好文   时间:2019-02-02 14:12:15    阅读次数:149
反演的形式
1 const int maxn=60000+5; 2 bool vis[maxn]; 3 int prime[maxn],mu[maxn]; 4 void init_mu(int n){ 5 int cnt=0; 6 mu[1]=1; 7 for(int i=2;i<n;i++){ 8 if(!v... ...
分类:其他好文   时间:2019-02-02 12:53:22    阅读次数:168
cf 893 E
有 次询问,第 次询问包含两个数 。 求满足下面两个要求的 数组的方案数。 1. 数组由 个整数构成 2. A与B不同当且仅当至少存在一个数 满足 。答案对 取模 数据范围: 显然对x分解质因数,如果某个质因子幂次为t,根据挡板法对答案的贡献就是 。 又因为可是是负的,每次挑选偶数个让它变成负的,那 ...
分类:其他好文   时间:2019-02-02 10:45:11    阅读次数:287
PAT Advanced 1001
1001 A+B Format (20 分) Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (un ...
分类:其他好文   时间:2019-01-31 01:28:26    阅读次数:172
oj 1002题 (大数题)
题目: Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input 一致 确定的 The ...
分类:其他好文   时间:2019-01-29 22:04:07    阅读次数:165
3428条   上一页 1 ... 47 48 49 50 51 ... 343 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!