UVa11526 H(n)

http://blog.csdn.net/synapse7/article/details/12873437

 #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iostream> using namespace std; typedef long long LL; #include<cmath>
LL H(int n) {
LL res = ;
int m = floor(sqrt(n + 0.1));
for(int i = ; i <= m; i++) {
res += n / i;
}
return (res << ) - m * m;
} int main() {
int T, n; scanf("%d", &T);
while(T--) {
scanf("%d", &n);
printf("%lld\n", H(n));
} return ;
}
上一篇:C# - Environment类,获取桌面的路径


下一篇:NSThread 子线程 Cocoa NSOperation GCD(Grand Central Dispatch) 多线程