Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. #define gc getchar unlocked
  6. #ifndef ONLINE JUDGE
  7. #define gc getchar
  8. #endif // ONLINE JUDGE
  9.  
  10. #define pc putchar_unlocked
  11. #ifndef ONLINE JUDGE
  12. #define pc putchar
  13. #endif // ONLINE JUDGE
  14.  
  15. #define fRead freopen("input.txt","r",stdin)
  16. #define fWrite freopen ("output.txt","w",stdout)
  17.  
  18. #define eps 1e-8
  19. #define inf 0x3f3f3f3f
  20. #define INF 2e18
  21. #define LL long long
  22. #define ULL unsigned long long
  23. #define PI acos(-1.0)
  24. #define pb push_back
  25. #define mk make_pair
  26. #define pii pair<int,int>
  27. #define pLL pair<LL,LL>
  28. #define ff first
  29. #define ss second
  30. #define all(a) a.begin(),a.end()
  31. #define rall(a) a.rbegin(),a.rend()
  32. #define SQR(a) ((a)*(a))
  33. #define Unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
  34. #define min3(a,b,c) min(a,min(b,c))
  35. #define max3(a,b,c) max(a,max(b,c))
  36. #define min4(a,b,c,d) min(min(a,b),min(c,d))
  37. #define max4(a,b,c,d) max(max(a,b),max(c,d))
  38. #define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
  39. #define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
  40. #define Iterator(a) __typeof__(a.begin())
  41. #define rIterator(a) __typeof__(a.rbegin())
  42. #define FOR(a,it) for(Iterator(a) it = a.begin();it != a.end(); it++)
  43. #define rFOR(a,it) for(rIterator(a) it = a.rbegin();it != a.rend(); it++)
  44. #define FastRead ios_base::sync_with_stdio(0);cin.tie(0)
  45. #define CasePrint pc('C'); pc('a'); pc('s'); pc('e'); pc(' '); write(qq++,false); pc(':'); pc(' ')
  46. #define vi vector <int>
  47. #define vL vector <LL>
  48. #define For(I,A,B) for(int I = (A); I < (B); ++I)
  49. #define rFor(I,A,B) for(int I = (A); I >= (B); --I)
  50. #define Rep(I,N) For(I,0,N)
  51. #define REP(I,N) For(I, 1, N + 1)
  52.  
  53. using namespace std;
  54.  
  55. const int MOD = 1e9 + 7;
  56. int fx[] = {-1,+0,+1,+0,+1,+1,-1,-1,+0};
  57. int fy[] = {+0,-1,+0,+1,+1,-1,+1,-1,+0};
  58. template <typename T> inline T GCD (T a,T b ) {a = abs(a);b = abs(b); if(a < b) swap(a, b); while ( b ) { a = a % b; swap ( a, b ); } return a;}
  59. template <typename T> inline T EGCD(T a,T b,T &x,T &y){if(a == 0) {x = 0;y = 1;return b;}T x1, y1;T d = EGCD(b % a, a, x1, y1);x = y1 - (b / a) * x1;y = x1;return d;}
  60. template <typename T> inline T LCM(T x,T y){T tp = GCD(x,y);if( (x / tp) * 1. * y > 9e18) return 9e18;return (x / tp) * y;}
  61. template <typename T> inline T BigMod(T A,T B,T M = MOD){T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
  62. template <typename T> inline T InvMod (T A,T M = MOD){return BigMod(A,M-2,M);}
  63. /*---------------------------fast I/O------------------------------------*/
  64. #define scani2(a,b) scani(a) , scani(b)
  65. #define scani3(a,b,c) scani(a), scani(b), scani(c)
  66. #define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
  67. #define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
  68. template <typename T> T scani(T &n){n = 0;bool negative = false;char c = gc();while( c < '0' || c > '9'){if(c == '-') negative = true;c = gc();}while(c >= '0' && c <= '9'){n = n*10 + c-48;c = gc();}if(negative) n = ~(n-1);return n;}
  69. template <typename T> void write(T n,int type = true){if(n<0) {pc('-');n = -n;}if(!n) {pc('0');if(type==32) pc(' '); else if(type) pc('\n'); return;}char buff[22];int len = 0;while(n) buff[len++] = n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);if(type==32) pc(' '); else if(type) pc('\n');}
  70. int scans(char *a){int i=0;char c = 0;while(c < 33) c = gc();while(c > 33){a[i++] = c;c = gc();}a[i] = 0;return i;}
  71. /*********************************************** End of template *********************************************/
  72. const int N = 2000005;
  73. const int M = 66;
  74.  
  75. int ans[N];
  76.  
  77. int main()
  78. {
  79. ans[1] = 1;
  80. For(i, 0, 20){
  81. int x = 0;
  82. For(j, (1 << i) + 1, (1 << (i + 1)) + 1) ans[j] = (x += 2);
  83. }
  84. int n;
  85. while(scani(n)){
  86. write(ans[n]);
  87. }
  88. return 0;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement