码迷,mamicode.com
首页 >  
搜索关键字:bear and prime numbe    ( 2904个结果
Really Big Numbers CodeForces - 817C (数学规律+二分)
C. Really Big Numbers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Really Big Numbe ...
分类:其他好文   时间:2019-01-28 01:05:25    阅读次数:178
pta-7-3素数对猜想(20分)
7-3 素数对猜想 (20 分)让我们定义d?n??为:d?n??=p?n+1???p?n??,其中p?i??是第i个素数。显然有d?1??=1,且对于n>1有d?n??是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(<10?5??),请计算不超过N的满足猜想的素数 ...
分类:其他好文   时间:2019-01-26 15:30:46    阅读次数:239
cf1009 D. Relatively Prime Graph
这道题是一道暴力题,看的数据量大是瞎胡人的,如果每个数都和1构成一条边实际上也就100000个数字,nlogn也一定能过去 然后就是注意m也不能太小,如果小于n-1就没法成图了。也不能太大,太大连不了那么多边 然后为了保证图的连通性,先把1和每个点都连一遍 ...
分类:其他好文   时间:2019-01-26 11:15:50    阅读次数:209
luogu3455 [POI2007]ZAP-Queries 简单的莫比乌斯反演
"link" ms是莫比乌斯反演里最水的题。。。 题意:对于给定的整数a,b和d,有多少正整数对x,y,满足x include using namespace std; bool visit[50010]; int prime[50010], mu[50010], tot, fuck = 50000 ...
分类:其他好文   时间:2019-01-25 20:25:14    阅读次数:192
loj #143. 质数判定
$\color{ 0066ff}{ 题目描述 }$ 判定输入的数是不是质数。 $\color{ 0066ff}{输入格式}$ 若干行,一行一个数 $x$。 行数不超过 $10^5$。 $\color{ 0066ff}{输出格式}$ 对于输入的每一行,如果 $x$ 是质数输出一行 $Y$,否则输出一行 ...
分类:其他好文   时间:2019-01-22 21:57:02    阅读次数:189
luogu3327 [SDOI2015]约数个数和
"link" 设$d(x)$表示x约数个数,给定n,m,$\sum_{i=1}^n\sum_{j=1}^md(ij)$ 多组询问,1 include using namespace std; int prime[50010], fuck = 50000, tot, d[50010], d1[5001 ...
分类:其他好文   时间:2019-01-21 16:12:44    阅读次数:157
判断一个数是否是质数(素数)
质数(prime number)又称素数,有无限个。 质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数。 // 封装一个函数,实现判断一个数是否是质数的功能 function isZS(m){ for(var i = 2; i < m;i++){ if(m % i 0){ //retu ...
分类:其他好文   时间:2019-01-20 22:06:36    阅读次数:255
luogu2257 YY的GCD--莫比乌斯反演
"link" 给定N, M,求1 include using namespace std; const int fuck = 10000000; int prime[10000010], tot; bool vis[10000010]; int mu[10000010], sum[10000010] ...
分类:其他好文   时间:2019-01-20 20:12:40    阅读次数:176
素数打表
1 const int maxn=1e7+5; 2 bool prime[maxn]; 3 int p[maxn]; 4 int tot; 5 void findprime() 6 { 7 for(int i = 2; i < maxn; i ++) prime[i] = true; 8 for(i... ...
分类:其他好文   时间:2019-01-20 20:10:50    阅读次数:180
luogu2658 GCD(莫比乌斯反演/欧拉函数)
"link" 给定整数N,求1 include using namespace std; const int fuck = 10000000; int prime[10000010], tot; bool vis[10000010]; int mu[10000010], sum[10000010]; ...
分类:其他好文   时间:2019-01-20 20:06:53    阅读次数:250
2904条   上一页 1 ... 42 43 44 45 46 ... 291 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!