摘要: 1 #include<stdio.h> 2 #include<math.h> 3 4 int w[25], min, ncases, total, i; 5 void dfs(int cur, int sum, int a[]) 6 { 7 int t; 8 if(cur == ncases) return ; 9 t =(int)fabs(total-sum-sum);10 if(t < min) min = t;11 dfs(cur+1, sum, a);12 dfs(cur+1, sum+a[cur], a);13 } 14 15 in... 阅读全文
posted @ 2012-03-07 22:29 zhongya 阅读(215) 评论(0) 推荐(1) 编辑