MCMF经典题,将行列聚成点建图,由于计算的是连乘积,用取对数的方法把乘法变成加法作为流量建图计算
#include
using namespace std;
const int INF = 0x7fffffff;
const int maxn = 1e5 + 50;
const double INFF = 1.0 * 1e18;
struct MEdge {
int from, to, cap;
double cost;
MEdge(int from, int to, int cap, double cost)
: from(from), to(to), cap(cap), cost(cost) {}
};
struct MCMF