3925专题

POJ 3925 Minimal Ratio Tree(枚举+最小生成树)

POJ 3925 Minimal Ratio Tree 题目链接 题意:给定一些点权和一个边权矩阵,求一个最小的比例的树 思路:先枚举用哪些点,然后求最小生成树即可 代码: #include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N = 20;int n

POJ 3925 Minimal Ratio Tree 最小生成树

思路是枚举+最小生成树,用DFS枚举或者二进制枚举。  /*ID: sdj22251PROG: calfflacLANG: C++*/#include <iostream>#include <vector>#include <list>#include <map>#include <set>#include <deque>#include <queue>#include