1 solutions

  • 1
    @ 2026-3-20 20:57:29
    #include<bits/stdc++.h>
    using namespace std;
    int _(int x)
    {
        int l=0,r=1000000000,mid=0,s=0;
        while (l<=r)
        {
            mid=(l+r)/2;
            //cout<<mid<<endl;
            if(mid==x)break;
            else if(mid>x)r=mid;
            else l=mid;
            s++;
        }
        return s+1;
    }
    int main()
    {
        int a,b,c;
        cin>>a>>b>>c;
        cout<<_(a )+_(b)+_(c);
    }
    
    • 1

    Information

    ID
    1840
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    8
    Accepted
    5
    Uploaded By