4 条题解

  • 0
    @ 2024-11-9 12:19:30
    #include <stdio.h>
    #include <math.h>
    
    int main()
    {
        unsigned long long result = 0;
        unsigned long long n;
        scanf("%llu", &n);
        unsigned long long x1 = (unsigned long long)pow(n, 1.0 / 3);
        unsigned long long x2 = (unsigned long long)pow(n, 1.0 / 2);
    
        for (unsigned long long a = 1; a <= x1+1; a++)
        {
            for (unsigned long long b = a; b <= x2+1; b++)
            {
                unsigned long long x = a * b;
                if (x * b > n)
                {
                    break;
                }
                unsigned long long maxc = n / x;
                if (b <= maxc)
                {
                    result += (maxc - b + 1);
                }
            }
        }
    
        printf("%llu\n", result);
        return 0;
    }
    
    

    信息

    ID
    79
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    递交数
    905
    已通过
    120
    上传者