Description
The numbers of offices in the new building of the Office of the IT city would have lucky numbers.
Lucky number is a number, consists of digits 7 and 8 only. Find the maximum number of offices in the new building of the tax Office given that a door-plate can hold a number not Lon GER than n digits.
Input
The only line of input contains one integer n (1≤ n ≤55)-the Maximum length of a number t Hat a door-plate can hold.
Output
Output one integer-the maximum number of offices, than can has unique lucky numbers not longer than n Digi Ts.
Examples
input
2
Output
6
1-digit, 7 8
2-digit, 77 78 87 88
3-digit, 777 778 787 788 877 878 887 888
.....
#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <math.h> #include <sstream> #include <set> #include <queue> #include <map> #include < vector> #include <algorithm> #include <limits.h> #define INF 0x7fffffff#define inf 0x7fffffffffffffff# Define Lson l,m,rt<<1#define Rson m+1,r,rt<<1|1#define LL long long#define ULL unsigned long longusing Namespa CE std; ll Powl (ll X, ll N) { ll pw = 1; while (n > 0) { if (N & 1) //N & 1 equivalent to (n% 2) = = 1 pw *= x; x *= x; n >>= 1; N >>= 1 equivalent to n/= 2 } return PW; int main () { LL n; LL num; cin>>n; Cout<<powl (2,n+1) -2<<endl; printf ("%.20f\n", N*powl (1.000000011,num)); return 0;}
Experimental educational round:volbit formulas Blitz C