摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1045 暴力搜索View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdlib> 4 #include<cstdio> 5 using namespace std; 6 char mat[10][10]; 7 int n,maxx; 8 bool ok(int x,int y)//put here is ok 9 {10 if(mat[x][y]!='.') return 阅读全文
posted @ 2012-04-01 23:24 keepmoving89 阅读(112) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1114背包View Code 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cmath> 5 using namespace std; 6 #define INF 99999999 7 struct node 8 { 9 int w;10 int v;11 };12 node a[508];13 int dp[10008];14 int n,sum;15 void s 阅读全文
posted @ 2012-04-01 12:44 keepmoving89 阅读(117) 评论(0) 推荐(0) 编辑
摘要: http://ac.jobdu.com/problem.php?id=1395完全背包View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 using namespace std; 5 int item[60]; 6 int dp[500008]; 7 int main() 8 { 9 int n;10 while(scanf("%d",&n)==1)11 {12 int i,j,sum=0;13 for(i=1;i<=n;i++) s 阅读全文
posted @ 2012-04-01 10:33 keepmoving89 阅读(279) 评论(0) 推荐(0) 编辑