Number of Containers [ZOJ 3126]
2013-05-07 20:53
417 查看
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3216
View Code
View Code
//复杂度O(sqrt(N)),蛮有意思的 const int MM = 11111; typedef long long int64; int64 N; void solve() { int64 i,j,k,sum=0,tmp; scanf("%lld",&N); for(i=1;(i*i)<=N;i++) { tmp=N/i; sum=sum+i*(N/i-N/(i+1)); if(tmp!=i) sum=sum+tmp*(N/tmp-N/(tmp+1)); } printf("%lld\n",sum-N); }
相关文章推荐
- zoj 3175 Number of Containers
- zoj 3175 Number of Containers (nbut1375) 计算n /1+n/2+n/3+n/4....+n/n
- zoj 3175 Number of Containers 分块加速
- TOJ 2909 ZOJ 3175 Number of Containers / 数论
- ZOJ 3175 Number of Containers 【数学图像性质(一个常见算式的经典计算)】
- zoj 3175 Number of Containers (大数灵活题,除2改成平方根)
- ZOJ - 3175 Number of Containers
- LeetCode解题报告—— Container With Most Water & 3Sum Closest & Letter Combinations of a Phone Number
- zoj 3175 Number of Containers(数论~)
- ZOJ 2523 —— Number of People(数论,胡搞)
- ZOJ 3175 Number of Containers(n/1+n/2+...+n/(n-1)+n/n求法)
- ZOJ 3869:Ace of Aces【水】
- 【17】Letter Combinations of a Phone Number
- LeetCode Letter Combinations of a Phone Number 电话号码组合
- 17. Letter Combinations of a Phone Number
- A - Ace of Aces——ZOJ
- container_of 详解
- eclipse 第三方jar包 关联源码,提示 The Jar of this class file belongs to container 'Android Dependencies'
- Python 刷题日记: Letter Combination of a Phone Number
- VIII.1 INS-30510: Insufficient number of ASM disks selected.