fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. long long n;
  7. cin >> n;
  8.  
  9. unsigned x=0;
  10. for (;n;x++)
  11. n>>=1;
  12. cout <<" "<< (1ULL << x) - 1;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5464KB
stdin
288230376151711743
stdout
 288230376151711743