2 条题解

  • 1
    @ 2025-04-06 14:13:34

    #include <bits/stdc++.h>
    #define int long long
    using namespace std;

    signed main()
    {
    ios::sync_with_stdio(false);
    int n,count=0,i=0,t;
    cin>>n;
    if(!n)
    {
    cout<<1;
    return 0;
    }
    while(count!=n)
    {
    i+=5;
    t=i;
    while(t%5==0)
    {
    count++;
    t=t/5;
    }
    }
    if(count==n)
    {
    cout<<i;
    }
    else
    {
    cout<<"No solution";
    }
    return 0;
    }

  • 0
    #include <bits/stdc++.h>
    #define int long long
    using namespace std;
    
    signed main()
    {
        ios::sync_with_stdio(false);
        int n,count=0,i=0,t;
        cin>>n;
        if(!n)
        {
            cout<<1;
            return 0;
        }
        while(count!=n)
        {
            i+=5;
            t=i;
            while(t%5==0)
            {
                count++;
                t=t/5;
            }
        }
        if(count==n)
        {
            cout<<i;
        }
        else
        {
            cout<<"No solution";
        }
        return 0;
    }
    
    • @ 2024-08-23 13:32:55

      额,如果输入无解的数(比如5)就陷入死循环了

  • 1

信息

ID
1009
难度
5
分类
(无)
标签
递交数
90
已通过
33
通过率
37%
被复制
6
上传者