Experimental Educational Round: VolBIT Formulas Blitz C
2024-08-31 04:11:04
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;
}
最新文章
- django开发个人简易Blog——数据模型
- make的控制函数(error,warning)
- 通过SEP禁用USB
- MySQL- 锁(3)
- thinkphp @代表什么
- -_-#【Angular】定义服务
- word2016怎么从第三页开始设置页码
- python之twisted模块安装
- VS2008与opencv结合使用的方法
- vs 2010调用matlab dll显示窗口核心代码
- C语言学习及应用笔记之二:C语言static关键字及其使用
- format 用法
- C#之app.config、exe.config和vshost.exe.config作用区别
- MVC常用筛选器Filter
- 2.2.10数据类型String的常量池特性
- Make the DbContext Ambient with UnitOfWorkScope(now named DbContextScope by mehdime)
- NavigateToPageAction打开新页面
- 获取页面所有链接的JS
- 50 Jquery 库
- 结对编程--fault,error,failure的程序设计