5 solutions

  • 0
    @ 2026-10-17 10:47:21
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n,c;
        cin>>n;
        c=n;
        n=abs(n);
        bitset<32> a(n);
        if(c<0){
            a[31]=1;
        }
        cout<<a;
        return 0;
    }
    

    Information

    ID
    128
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    77
    Accepted
    30
    Uploaded By