The mook jong-dp

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


dp

#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <vector>
#define inf 1099511627776
using namespace std;
  
int main()
{
	__int64 i;
	__int64 a[65]={0,1,2,3,5};
	for (i=5;i<=60;i++)
		a[i]=a[i-1]+a[i-3]+1;
__int64 n;
	while(scanf("%I64d",&n)!=EOF)
	{
		printf("%I64d\n",a[n]);
	}  
	
	
	
	
	
	
	
	
	
	
	
	return 0;
	
}


你可能感兴趣的:(The mook jong-dp)