2 条题解

  • 2
    @ 2023-10-6 17:48:46
    #include <bits/stdc++.h>
    using namespace std;
    int a[40000];
    int x,j,n;
    void p(int f)
    {
        for(int i = 0; i <= x; i++)
        {
            if(a[i] >= 100000)
            {
                a[i + 1] += a[i] / 100000;
                a[i] %= 100000;
                if(i == x)
                {
                    x++;
                }
            }
            a[i] *= f;
        }
        a[0] += f;
    }
    int main()
    {
        scanf("%d",&a[0]);
        for(int i = a[0] - 1; i >= 1; i--)
        {
            p(i);
        }
        for(int i = 0; i <= x; i++)
        {
            if(a[i] >= 100000)
            {
                a[i + 1] += a[i] / 100000;
                a[i] %= 100000;
                if(i == x)
                {
                    x++;
                }
            }
        }
        for(int i = x + 1; i >= 0; i--)
        {
            if(a[i])
            {
                printf("%d",a[i]);
                for(i--; i >= 0; i--)
                {
                    printf("%.5d",a[i]);
                }
            }
        }
        return 0;
    }
    
    • 0
      @ 2023-8-14 19:30:05

      6

    • 1

    信息

    ID
    1759
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    17
    已通过
    0
    上传者