• Experimental Educational Round: VolBIT Formulas Blitz C


    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*powl(1.000000011,num));
        return 0;
    }
    

      

  • 相关阅读:
    转:中国菜刀用法
    转的:burp suite小例子
    [转]阿里前员工评马云
    Burp Suite使用教程
    C++实现按绩点排名
    C++排列对称串
    C++实现01串排序
    C++判断五位以内的对称素数
    C++12!配对
    C++列出完数
  • 原文地址:https://www.cnblogs.com/yinghualuowu/p/5208367.html
Copyright © 2020-2023  润新知