- 博客(4)
- 收藏
- 关注
原创 UVA 753 - A Plug for UNIX
最大流的模板题 前n个 连接汇点 中间m个连接源点 最后k个为中间路径 #include #include #include #include #include using namespace std; #define M 2020 #define INF 1 int n,m,s,t,k,l; int head[M],end[M]; int flow[M][M
2012-12-07 17:41:20 336
原创 11045 - My T-shirt suits me
最大流的问题 设立一个源点为0 与衣服之间的容量为n/6 一个汇点 与志愿者之间的容量为1 志愿者与衣服之间容量为1 图建好了 套上模版就能AC #include #include #include using namespace std; #define M 220 #define INF 1 int n,m,s,t; int flow[M][M],cap[M][M]
2012-12-05 22:18:54 479
原创 10330 - Power Transmission
最大流问题 需要设一个超级源 超级会点 结点也有容量 所以建图的时候要注意一下 #include #include #include using namespace std; #define M 220 #define INF 1 int n,m,B,D,t; int head[M],end[M]; int flow[M][M],cap[M][M],a[M],p[M];
2012-12-05 22:16:39 497
原创 10803 - Thunder Mountain
求出任意A点到B点 的最大距离 folyd求各点出间的距离 #include #include #include double x[110],y[110]; double d[110][110]; double dis(int i,int j) { double l1 = x[i] - x[j]; double l2 = y[i] - y[j];
2012-12-02 21:42:03 453
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人