Advertisement
saira12tabassum19

Untitled

May 15th, 2020
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef vector<int> v;
  5. typedef pair<int,int>p;
  6. #define ll long long
  7. #define fr(i,a,b) for(int i=a;i<b;i++)
  8. #define fre(i,a,b) for(int i=a;i<=b;i++)
  9. #define FOR(i,a,b) for(int i=a;i>b;--i)
  10. #define FORE(i,a,b) for(int i=a;i>=b;--i)
  11. #define f first
  12. #define s second
  13. #define pb push_back
  14. #define mp make_pair
  15. #define lb lower_bound
  16. #define ub upper_bound
  17.  
  18. int main()
  19. {
  20. ios::sync_with_stdio(0);
  21. cin.tie(0); cout.tie(0);
  22. ll int n,sum=0,b=1;
  23. cin>>n;
  24. fre(i,1,n){b*=2;sum+=b;}
  25. cout<<sum<<endl;
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement