fork download
  1. // author : www.codechef.com/users/simclev
  2. #include <iostream>
  3. #include <cstdio>
  4. #define fastio {ios_base::sync_with_stdio(NULL); cin.tie(NULL);}
  5. #define slong signed long long
  6. #define ulong unsigned long long
  7. #define lastElim 0x7FFFFFFFFFFFFFFF
  8. using namespace std;
  9.  
  10. void get_slong(slong &x) {
  11. register int c = getchar_unlocked();
  12. x = 0;
  13. bool minus = 0;
  14. for(;!(c>='0' && c<='9' || c=='-'); c = getchar_unlocked());
  15. if(c=='-'){
  16. minus = 1;
  17. c = getchar_unlocked();
  18. }
  19. for(;c>='0' && c<='9'; c=getchar_unlocked())
  20. x = (x<<1) + (x<<3) + (c&15);
  21. if(minus)
  22. x = -x;
  23. }
  24.  
  25. int main(){
  26. slong t;
  27. get_slong(t);
  28. while(t--){
  29. slong value;
  30. ulong res;
  31. get_slong(value);
  32. value >>= 1;
  33. res = (value & lastElim);
  34. printf("%llu\n",res);
  35. }
  36. return 0;
  37. }
Success #stdin #stdout 0s 15240KB
stdin
1
5
stdout
2