http://www.lydsy.com/JudgeOnline/problem.php?id=1968
换个角度
一个数可以成为几个数的约数
#include<cstdio> #include<iostream> using namespace std; int main() { int n; long long ans=0; scanf("%d",&n); for(int i=1;i<=n;++i) ans+=n/i; cout<<ans; }
1968: [Ahoi2005]COMMON 约数研究
Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 3290 Solved: 2234
[Submit][Status][Discuss]