HDU 5750 Dertouzos 简单数学】的更多相关文章

感悟:这又是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很小…
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…
Equations 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1840 ——每天在线,欢迎留言谈论. 题目大意: 给你一个一元二次方程组,a(X^2) + b(X) + c = 0 .求X解的个数. 思路: 分别讨论二次方程与一次方程的情况,再特殊处理下 a = b = c = 0 的情况. 感想: 是时候该水水题了. Java AC代码: import java.math.*; import java.util.Scanner; public…
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…
HDU 5073 Galaxy (2014 Anshan D简单数学) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5073 Description Good news for us: to release the financial pressure, the government started selling galaxies and we can buy them from now on! The first one who bought…
题意: N个人,每个人AC的题数都不一样. Eddy想从中选出一部分人(或者全部)分成两组.必须满足第一组中的最小AC数大于第二组中的最大AC数. 问共有多少种不同的选择方案. 思路: 简单数学.. 代码: ll C(int n,int x){ ll ans=1; rep(i,1,x){ ans = ans*(n+1-i)/i; } return ans; } int main(){ int n; while(cin>>n){ ll ans = 0; rep(i,2,n){ ans += (C…
HDU 2085 核反应堆 /* HDU 2085 核反应堆 --- 简单递推 */ #include <cstdio> ; long long a[N], b[N]; //a表示高能质点数目,b表示低能质点数目 int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #endif //质点数目初始化 a[] = ;b[] = ; ; i <= ; ++i){ a[i] =…
洛谷试炼场-简单数学问题 P1403 [AHOI2005]约数研究 Description 科学家们在Samuel星球上的探险得到了丰富的能源储备,这使得空间站中大型计算机"Samuel II"的长时间运算成为了可能.由于在去年一年的辛苦工作取得了不错的成绩,小联被允许用"Samuel II"进行数学研究. 小联最近在研究和约数有关的问题,他统计每个正数N的约数的个数,并以f(N)来表示.例如12的约数有1.2.3.4.6.12.因此f(12)=6.下表给出了一些f…