1 条题解

  • 0
    @ 2025-10-8 16:50:56
    #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;
    }
    
    • 1

    【一维除法分块加速】商求和[scy]

    信息

    ID
    505
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    221
    已通过
    72
    上传者