欢迎访问我的个人网站==》 jiashubing.cn
摘要: 题目链接:http://poj.org/problem?id=1564题目大意:给定一个整数t,和n个元素组成的集合。求能否用该集合中的元素和表示该整数,如果可以输出所有可行解。1 2 # include 3 # include 4 using namespace std; 5 bool cmp(int a,int b){ 6 return a>b; 7 } 8 int a[15],t,n; 9 bool flag;10 int ans[15],len;11 12 void dfs(int sum,int mark){13 int i;14 if(sum == 0){1... 阅读全文
posted @ 2013-08-27 21:50 贾树丙 阅读(228) 评论(0) 推荐(0) 编辑