Chemistry

Time Limit: 2000ms, Special Time Limit:5000ms, Memory Limit:262144KB
Total submit users: 33, Accepted users: 29
Problem 12907 : No special judgement
Problem description


Input

The only line of the input file contains a single integer number n — the number of carbon atoms in alkane molecule (1 ≤ n ≤ 50).


Output

The only line of output file should contain the number of different CnH2n+2i somers. It is guaranteed that the answer fits signed 64-bit integer type.


Sample Input
6

12
Sample Output
5

355
 
#include<stdio.h>
#define ll __int64

ll a[51];
int main()
{
    a[0]=0;a[1]=1;a[2]=1;a[3]=1;a[4]=2;a[5]=3;a[6]=5;a[7]=9;a[8]=18;a[9]=35;a[10]=75;a[11]=159;a[12]=355;
a[13]=802;
a[14]=1858;
a[15]=4347;
a[16]=10359;
a[17]=24894;
a[18]=60523;
a[19]=148284;
a[20]=366319;
a[21]=910726;
a[22]=2278658;
a[23]=5731580;
a[24]=14490245 ;
a[25]=36797588;
a[26]=93839412;
a[27]=240215803 ;
a[28]=617105614 ;
a[29]=1590507121 ;
a[30]=4111846763;
a[31]=10660307791 ;
a[32]=27711253769;
a[33]=72214088660 ;
a[34]=188626236139 ;
a[35]=493782952902;
a[36]=1295297588128;
a[37]=3404490780161;
a[38]=8964747474595;
a[39]=23647478933969 ;
a[40]=62481801147341 ;
a[41]=165351455535782;
a[42]=438242894769226 ;
a[43]=1163169707886427;
a[44]=3091461011836856;
a[45]=8227162372221203;
a[46]=21921834086683418 ;
a[47]=58481806621987010 ;
a[48]=156192366474590639;
a[49]=417612400765382272 ;
a[50]=1117743651746953270;
int n;
while(scanf("%d",&n)!=EOF)
   printf("%I64d\n",a[n]);
return 0;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值