#include<bits/stdc++.h> #define LL long long using namespace std; int main() { LL n;scanf("%lld", &n); LL ans=0; for(LL l=1, r; l <= n; l = r + 1) { r = n / (n / l); ans += (n / l) * (r - l + 1); } printf("%lld\n", ans); return 0; }
注册一个 oirush 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 oirush 通用账户