6 solutions

  • 0
    @ 2025-3-23 21:36:08
    #include<iostream>
    #include<cmath>
    using namespace std;
    bool mici(int x)
    {
        return x > 0 && (x & (x-1)) == 0;
    }
    int main()
    {
        int m;
        cin>>m;
        while(m--)
        {
            int n;cin>>n;
            if(mici(n))cout<<"YES"<<"\n";
            else cout<<"NO"<<"\n";
        }
    
        return 0; 
    }
    
    

    Information

    ID
    47
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    1548
    Accepted
    244
    Uploaded By