/* 要求出[1,R]之间的质数会超时,但是要判断[L,R]之间的数是否是素数却不用筛到R 因为要一个合数n的最大质因子不会超过sqrt(n) 所以只要将[2,sqrt(R)]之间的素数筛出来,再用这些素数去筛[L,R]之间的合数即可 */ #include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; #define ll long lon…
问题 B: N! 普拉斯 时间限制: 1 Sec  内存限制: 128 MB提交: 114  解决: 35[提交] [状态] [讨论版] [命题人:admin] 题目描述 在处理阶乘时也需要借助计算器. 在计算机中,数字是通过像01像素矩阵来显示的,最终的显示效果如下:  宝儿姐一直在思考一个问题,N!末尾究竟有多少个0?我们假设N!末尾有k个0,请按照规则打印k.  输入 输入一个正整数n(n< 50) ,输入以EOF结尾. 输出 我们假设N!末尾有k个0,请按照规则打印k,数字之间间隔3列0…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1124 Problem Description The most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this term gave the name to the cellular phon…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1124 思路:每五个数1个0,5个5就2个0(不用管2,一定充足) #include<iostream> #include<cstdio> #include<cmath> using namespace std; typedef long long LL; int main(void) { LL n,j; int tim,ans,t,i; scanf("%d&quo…
题意: 求n!的尾0的个数 分析: 0一定是由因子2和5相乘产生的: 2的个数显然大于5的个数,故只需统计因子5的个数 n/5不能完全表示n!中5的个数(egg: 25),应该n/=5后,累加上n/2. (每个因子5相隔5个数字,将间隔看成一个数,然后隔5个,又出现因子5) #include<stdio.h> int main() { int n,ans,x; scanf("%d",&n); while(n--) { ans=; scanf("%d&quo…
http://acm.hdu.edu.cn/showproblem.php?pid=3641 学到: 1.二分求符合条件的最小值 /*==================================================== 二分查找符合条件的最小值 ======================================================*/ ll solve() { __int64 low = 0, high = INF, mid ; while(low <=…
对长为L的棒子随机取一点分割两部分,抛弃左边一部分,重复过程,直到长度小于d,问操作次数的期望. 区域赛的题,比较基础的概率论,我记得教材上有道很像的题,对1/len积分,$ln(L)-ln(d)+1$. /** @Date : 2017-10-06 14:32:03 * @FileName: HDU 5984 数学期望.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://gi…
You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13549    Accepted Submission(s): 6645 Problem Description Many geometry(几何)problems were designed in the ACM/…
标题:乘积尾零 如下的10行数据,每行有10个整数,请你求出它们的乘积的末尾有多少个零? 5650 4542 3554 473 946 4114 3871 9073 90 4329 2758 7949 6113 5659 5245 7432 3051 4434 6704 3594 9937 1173 6866 3397 4759 7557 3070 2287 1453 9899 1486 5722 3135 1170 4014 5510 5120 729 2880 9019 2049 698 4…
原创 标题:乘积尾零 如下的10行数据,每行有10个整数,请你求出它们的乘积的末尾有多少个零? 5650 4542 3554 473 946 4114 3871 9073 90 4329 2758 7949 6113 5659 5245 7432 3051 4434 6704 3594  9937 1173 6866 3397 4759 7557 3070 2287 1453 9899  1486 5722 3135 1170 4014 5510 5120 729 2880 9019  2049…