1 solutions

  • 0
    @ 2025-5-7 14:10:33

    O(1)

    两个互质的数不能够凑出来的最大的数是(a-1)*(b-1)-1

    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    int main()
    {
        LL a,b;
        cin>>a>>b;
        LL res=(a-1)*(b-1)-1;
        cout<<res;
        return 0;
    }
    
    • 1

    Information

    ID
    1124
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By