HDU 5366 The mook jong

先暴力写了一个DFS,然后找规律。。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

__int64 dp[1000];

int main()
{
    dp[1]=1;
    dp[2]=2;
    dp[3]=3;
    dp[4]=5;
    for(int i=5;i<=60;i++)
     dp[i]=dp[i-1]+1+dp[i-3];
    int n;
    while(~scanf("%d",&n))
     printf(
"%I64d ",dp[n]); return 0; }
原文地址:https://www.cnblogs.com/zufezzt/p/4714499.html