fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. int n;
  8. cin>>n;
  9. int x=1<<((int)ceil(log2(n)));
  10. cout<<log2(n) <<" "<< ceil(log2(n)) << " " << (int)ceil(log2(n)) << " " << x << " "<< x-n <<"\n";
  11. // int x=(1<<((int)ceil(log2(n)))-n);
  12. int y=__builtin_popcount(n);
  13. cout<<"y= "<<y<<"\n";
  14. // cout<<"x = "<<x;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
-inf -inf -2147483648 1 1
y= 0