问题描述
问题分析
lucky numbers
也就是只包含7或8的数字
问不超过n位的lucky numbers有多少
一道排列组合题目
1
2
3
4
5
6
7
8
9
10
11
12
| #include<stdio.h>
#include<math.h>
int main() {
long long a[60]= {0};
for(int i=1; i<56; i++)
a[i]=pow(2,i)+a[i-1];
int n;
while(scanf("%d",&n)!=EOF) {
printf("%lld\n",a[n]);
}
return 0;
}
|
题目地址:【CodeForces】[630C]Lucky Numbers