摘要: 组合树枝成最短长。回溯大家都知道,复杂的是直接提交一定TLE,要剪枝。。。 笔者没有深入的思考,在网上找了一篇说的比较好的,分享下:http://blog.sina.com.cn/s/blog_520db5ec0100copn.html 笔者的代码如下:#include <iostream>#include <algorithm>using namespace std;int n,s[99],v[99],sum,t,num,m;bool DFS(int x,int y){ int i; if(y==num) return true; for(i=0;i<... 阅读全文
posted @ 2013-03-02 20:31 SF-_- 阅读(268) 评论(0) 推荐(0) 编辑