Tanky WooRSS

HDOJ 2047 阿牛的EOF牛肉串

29 Jul 2010
这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。

题目地址:

http://acm.hdu.edu.cn/showproblem.php?pid=2047

 // Author: Tanky Woo
// HDOJ 2047

#include 
#include 
using namespace std;

__int64 beaf[50];
int main()
{
    int n;
    beaf[1] = 3;
    beaf[2] = 8;
    beaf[3] = 22;
    for(int i=4; i<=40; ++i)
        beaf[i] = 6*beaf[i-2] + 4*beaf[i-3];
    while(scanf("%d", &n;) != EOF)
    {
        printf("%I64d\n", beaf[n]);
    }
    return 0;
}