摘要: 其实本题函数递归都给我们了。但是就是说,要用一般简单的函数的话,就会超时(我试过。)然后我参考了别人博客构造一个三维数组"int d[a][b][c]",用来记忆。真的用到的是后面“ if(d[a][b][c]) return d[a][b][c];”只要曾经算过得就可以记下了。减少了计算时间了!View Code #include <iostream>#include<cstdio>using namespace std;int d[21][21][21]; int w(int a,int b,int c){ if(a<=0||b<=0 阅读全文
posted @ 2013-04-11 20:27 90后程序媛 阅读(269) 评论(0) 推荐(0) 编辑