1 solutions

  • 0
    @ 2025-12-3 8:31:38

    C++ :

    #include<bits/stdc++.h>
    #define int long long
    using namespace std;
    int a,b,c,sum,x[10000005],t;
    signed main()
    {
        cin>>a>>b>>c;
        for(int i1=0;i1<=4;i1++)
        for(int i2=0;i2<=4;i2++)
        for(int i3=0;i3<=4;i3++)
        for(int i4=0;i4<=i1;i4++)
        for(int i5=0;i5<=i2;i5++)
        for(int i6=0;i6<=i3;i6++)
        {
            t=(i1-i4)*a+(i2-i5)*b+(i3-i6)*c-i4*a-i5*b-i6*c;
            if(t>0)
            {
                if(x[t]==0)sum++;
                x[t]=1;
            }
        }
        cout<<sum;
        return 0;
    }
    
    • 1

    Information

    ID
    754
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    3
    Accepted
    3
    Uploaded By