4 solutions

  • 1
    @ 2024-10-22 12:28:46
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int m;
        cin>>m;
        int s=0,n=1;
        while(s<=m)
        {
            s+=n;
            n++;
        }
        n--;
        cout<<n;
        return 0;
    }
    

    Information

    ID
    48
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    165
    Accepted
    62
    Uploaded By