hdu2047阿牛的EOF牛肉串 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2047
这个题递归的思路没改出来,一直T.L.E,经高人指点,得用DP,思路简洁,且一条过。
以下是代码:
#include<iostream>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
long long a[48][3]={1,1,1};
if(n==1)cout<<"3"<<endl; /*
else if(n==39)cout<<"113610642749390848"<<endl;
else if(n==38)cout<<"41584381386555392"<<endl;
else if(n==37)cout<<"15220939988140032"<<endl;
else if(n==36)cout<<"55712