标签:
1 //It is made by jump~ 2 #include <iostream> 3 #include <cstdlib> 4 #include <cstring> 5 #include <cstdio> 6 #include <cmath> 7 #include <algorithm> 8 #include <ctime> 9 #include <vector> 10 #include <queue> 11 #include <map> 12 #include <set> 13 using namespace std; 14 typedef long long LL; 15 int n,ans; 16 17 inline int getint() 18 { 19 int w=0,q=0; char c=getchar(); 20 while((c<‘0‘ || c>‘9‘) && c!=‘-‘) c=getchar(); if(c==‘-‘) q=1,c=getchar(); 21 while (c>=‘0‘ && c<=‘9‘) w=w*10+c-‘0‘, c=getchar(); return q ? -w : w; 22 } 23 24 inline void work(){ 25 n=getint(); for(int i=1;i<=n;i++) ans+=n/i; printf("%d",ans); 26 } 27 28 int main() 29 { 30 work(); 31 return 0; 32 }
BZOJ1968 [Ahoi2005]COMMON 约数研究
标签:
原文地址:http://www.cnblogs.com/ljh2000-jump/p/5870112.html