码迷,mamicode.com
首页 > 其他好文 > 详细

Experimental Educational Round: VolBIT Formulas Blitz C

时间:2016-02-22 23:37:55      阅读:362      评论:0      收藏:0      [点我收藏+]

标签:

Description

The numbers of all offices in the new building of the Tax Office of IT City will have lucky numbers.

Lucky number is a number that 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 longer than n digits.

Input

The only line of input contains one integer n (1 ≤ n ≤ 55) — the maximum length of a number that a door-plate can hold.

Output

Output one integer — the maximum number of offices, than can have unique lucky numbers not longer than n digits.

Examples
input
2
output
6
1位数的,7 8
2位数的,77 78 87 88
3位数的,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 long
using namespace std;
LL  powl(LL x, LL n)
{
    LL pw = 1;
    while (n > 0)
    {
        if (n & 1)        // n & 1 等价于 (n % 2) == 1
            pw *= x;
        x *= x;
        n >>= 1;        // n >>= 1 等价于 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

标签:

原文地址:http://www.cnblogs.com/yinghualuowu/p/5208367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!