• + 0 comments

    100% works. C++ solution.

    include

    include

    using namespace std;

    long solve(long n) { long k,count = 0; while(n!=0) {

        k=n%2;
    
        if(k==0)
        count++;
    
    
        n=n/2;
    
    }
    long result = pow(2,count);
    return result;
    

    }

    int main() { long n; cin >> n; long result = solve(n); cout << result << endl; return 0; }