hdu1331记忆化搜索

题目链接:点击打开链接

题意:求给的公式。

思路:记忆化搜索,暴力跑出来

#include 
#include
#include
using namespace std;
const int maxn=20+2;
int d[maxn][maxn][maxn],vis[maxn][maxn][maxn];
int w(int a,int b,int c)
{

   if(a<=0||b<=0||c<=0)return 1;
    if(a>20||b>20||c>20)return w(20,20,20);
if(vis[a][b][c])return d[a][b][c];
     vis[a][b][c]=1;
     if(a



你可能感兴趣的:(DP)