SHARE
TWEET

Untitled

Forna99 Jul 20th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main () {
  5.  
  6.  long long  int q,n,l,i;
  7. cin >> q;
  8. for (i=1;i<=q;i++) {
  9.     cin >> n;
  10.     l = (2*(n-pow(2,floor(log2(n)))))+1;
  11.     cout<<l<<endl;
  12.    
  13. }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top