首页 > TAG信息列表 > NC218398

NC218398 小G的约数

https://ac.nowcoder.com/acm/problem/218398 数论分块 在1~x 内,因数为 i 的数有 x/i 个,则约数和就是 x/i * i。 则G(n)就是 \[\sum_{i=1}^n i\times \lfloor \frac{n}{i} \rfloor \] 点击查看代码 #include <bits/stdc++.h> using namespace std; #define int long long int G(