Dertouzos (5750)】的更多相关文章

Dertouzos 题意: 就是给一个n和一个d,问有多少个小于n的数的最大因子是d. 分析: 如果一个数是质数,又和d互质,它们的乘积在范围内的话显然是满足条件的, 如果这个质数和d不互质,那么如果只有这个质数是d最小的质因子时才满足这个条件,其他都不满足, 输入样例 9 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 100 13 输出样例 1 2 1 0 0 0 0 0 4 #include <cstdio> #include <iostream&g…
Dertouzos Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1861    Accepted Submission(s): 584 Problem Description A positive proper divisor is a positive divisor of a number n, excluding n its…
Dertouzos 题意: 有中文,不说. 题解: 我看了别人的题解,还有个地方没懂, 为什么是 if(d%prime[i]==0) break; ? 代码: #include <bits/stdc++.h> using namespace std; const int INF=0x3f3f3f3f; typedef long long ll; #define PU puts(""); #define PI(A) printf("%d\n",A) #de…
Dertouzos Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 577    Accepted Submission(s): 160 Problem Description A positive proper divisor is a positive divisor of a number n, excluding n itse…
Dertouzos Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1415    Accepted Submission(s): 443 Problem Description A positive proper divisor is a positive divisor of a number n, excluding n its…
题目给定n和d,都是10的9次方以内,求1到n里面有几个数最大因数是d?1000000组数据.解:求出d的满足p[i]*d<n的最小质因数是第几个质数.即为答案. #include<cstdio> #define N 100002 int t,n,d,pr[N],p[N],num; int main(){ for(int i=2;i<N;i++)if(!pr[i]){ for(int j=i+i;j<N;j+=i) pr[j]=1; p[++num]=i; } scanf(&…
感悟:这又是zimpha巨出的一场题,然后04成功fst(也就是这题) 实际上还是too young,要努力增加姿势, 分析:直接枚举这些数不好枚举,换一个角度,枚举x*d,也就是d的另一个乘数是多少 显然  x<=min(d,(n-1)/d),x还得是质数,最后发现x必须小于d的最小因子 然后预处理10w以内的素数,然后每次先得到k=min(d,(n-1)/d),然后看d最小因子是否小于k 这题的关键就在找d的最小因子,我是暴力找的(然后碰上全是大素数就t了) 实际上当d是大素数的时候,k很小…
Problem Description A positive proper divisor is a positive divisor of a number n, excluding n itself. For example, 1, 2, and 3 are positive proper divisors of 6, but 6 itself is not.Peter has two positive integers n and d. He would like to know the…
Dertouzos Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 891    Accepted Submission(s): 274 Problem Description A positive proper divisor is a positive divisor of a number n, excluding n itse…
题目链接: Dertouzos Time Limit: 7000/3500 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Others) Problem Description A positive proper divisor is a positive divisor of a number n, excluding n itself. For example, 1, 2, and 3 are positive proper…