2-sat入门题,建图后直接模板就好了开始的时候竟然连了双向的边,晕。。。。。#include<stdio.h>#include<string.h>#include<vector>#include<algorithm>using namespace std;const int MAX = 10010;vector<int> edge[MAX];int st[MAX];int dfn[MAX],low[MAX];int top,btype,tdfn;//btype:连通块的个数int belong[MAX];//点属于哪个连通块bool Read More
posted @ 2011-11-12 23:48 Because Of You Views(251) Comments(0) Diggs(0) Edit
思想的话看这里http://www.cnblogs.com/lotus3x/archive/2009/03/21/1418480.html二分法:/*the length of the channel is the horizontal distance between the two villages. The cost of the channel is the height of the lifter. 最优比率生成树poj 2728目标:min{∑costi/∑leni}逼近的思想,∑costi/∑leni<=x,即 ∑(costi-x*leni)<=0 是一个单调递减函数 Read More
posted @ 2011-11-12 21:21 Because Of You Views(886) Comments(1) Diggs(0) Edit