![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
poj水题
u010912405
这个作者很懒,什么都没留下…
展开
-
poj 1664 放苹果(f(m,n)可以分为两种情况:f(m-n,n),j就是每个盒子都放+f(m,n-1)至少有一个盒子不放苹果)
#include #include using namespace std; int f(int m,int n) { if(m<0) return 0; if(m==0||m==1) return 1; if(n==1) return 1; return f(m-n,n)+f(m,n-1); } int main() { int T,t原创 2013-08-20 20:54:54 · 731 阅读 · 0 评论 -
poj 1253 三维数组+广搜+减枝
#include #include #include #include using namespace std; const int N=51; int A,B,C,step; int map[N][N][N]; int visited[N][N][N]; int ds[6][3]={{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,-1},{0,0,1}}; str原创 2013-08-20 20:51:21 · 849 阅读 · 0 评论 -
poj 1088滑雪 记忆化搜索
#include #include #include using namespace std; const int N=102; int s[N][N]; int map[N][N]; int inf=-0xffffff; int ds[4][2]={0,1,1,0,0,-1,-1,0}; int n,m; int judge(int a,int b) { if(a>=1&&a=1&原创 2013-08-23 13:17:19 · 397 阅读 · 0 评论