这篇博客是从旧博客 WordPress 迁移过来,内容可能存在转换异常。
动态规划~~~
题目地址:
http://acm.hdu.edu.cn/showproblem.php?pid=1579
// Author: Tanky Woo
// HDOJ 1579
#include
#include
using namespace std;
int fun[21][21][21];
int main()
{
for(int i=0; i<=20; ++i)
for(int j=0; j<=20; ++j)
{
fun[0][i][j] = 1;
fun[i][0][j] = 1;
fun[i][j][0] = 1;
}
for(int i=1; i<=20; ++i)
for(int j=1; j<=20; ++j)
for(int k=1; k<=20; ++k)
{
if(i 20 || b > 20 || c > 20)
printf("w(%d, %d, %d) = %d\n",a, b, c, fun[20][20][20]);
else
printf("w(%d, %d, %d) = %d\n",a, b, c, fun[a][b][c]);
}
return 0;
}