[AHOI 2005]COMMON 约数研究

时间:2020-12-04 05:01:44

Description

[AHOI 2005]COMMON 约数研究

Input

只有一行一个整数 N(0 < N < 1000000)。

Output

只有一行输出,为整数M,即f(1)到f(N)的累加和。

Sample Input

3

Sample Output

5

题解

水题一道...做不出的要$AFO$了...

 //It is made by Awson on 2017.11.10
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define LL long long
#define LD long double
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
#define sqr(x) ((x)*(x))
#define y1 yy
#define count COUNT
#define Lr(o) (o<<1)
#define Rr(o) (o<<1|1)
using namespace std;
const int N = ; int n;
LL ans; void work() {
scanf("%d", &n);
for (int i = ; i <= n; i++)
ans += n/i;
printf("%lld\n", ans);
}
int main() {
work();
return ;
}