HDU 5366 The mook jong

来源:互联网 发布:mac 安卓sdk环境变量 编辑:程序博客网 时间:2024/05/01 17:54

题目:http://acm.hdu.edu.cn/showproblem.php?pid=5366

代码:

#include<stdio.h>#include<string.h>using namespace std;int main(){    int a;    __int64 b[100]={0,1,2,3,5,8,13};    while(~scanf("%d",&a))    {        for(int i=3;i<=a;i++)        {            b[i]=b[i-1]+b[i-3]+1;        //too difficult        }        printf("%I64d\n",b[a]);    }}


0 0
原创粉丝点击