摘要: 找有这个题目的oj找的好辛苦算法详见黑书119页动态规划#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;struct toy{ int x; int y; int z;}p[110];//1代表x和y在上//2代表x和z在上//3代表y和z在上int d[110][110][110][4];int n,m;//编号为1,2,,,,n//d[i][a][b][k]表示已经 阅读全文
posted @ 2012-08-03 21:31 willzhang 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<math.h> 5 #include<algorithm> 6 using namespace std; 7 #define left 2 8 #define right 4 9 #define up 110 #define down 311 int n;12 int a[1000];13 int effort(int a,int b)14 {15 if(a==0)16 {17 return 阅读全文
posted @ 2012-08-03 14:24 willzhang 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;int linjie[110][110];int ans[110];int n;int t[110];int meet[110][110];//-1表示未初始化,0表示不能相遇,1表示能相遇void found(int l,int r){ int i; meet[l][r]=0; if(l==r-1) { meet[l][ 阅读全文
posted @ 2012-08-03 09:56 willzhang 阅读(158) 评论(0) 推荐(0) 编辑