poj 2112 网络流
来源:互联网 发布:托福报名 知乎 编辑:程序博客网 时间:2024/05/21 11:19
题意:有K台挤奶机(编号1~K),C头奶牛(编号K+1~K+C),给出各点之间距离。现在要让C头奶牛到挤奶机去挤奶,每台挤奶机只能处理M头奶牛,求使所走路程最远的奶牛的路程最短的方案。
构图:先Floyd求所有点对之间最短路,二分最短长度,若奶牛与挤奶机之间的距离大于mid则不连边,否则连容量为1的边。源向奶牛连容量1的边,机器向汇连容量m的边,用最大流判可行性。
#include <iostream>
#include<stdio.h>
#include<string.h>
const int maxn=1001;
const int inf=1<<30;
using namespace std;
int a[maxn][maxn],e[maxn][maxn];
int floyd(int n)
{
}
int level[maxn];
int makelevel(int s,int t)
{
}
int dfs(int now,int maxf,int t)
{
}
int dinic(int s,int t)
{
}
int main()
{
//
}
- poj 2112 网络流
- poj 2112 中等网络流
- ACM: 网络流 图论 poj 1459
- poj 1459 power network(网络流 di…
- poj 1459 power network(网络流 sa…
- ACM: 图论题 poj 1149 网络流问题
- poj 2488
- POJ 2485 Highways
- POJ 3299
- poj 1905
- poj 2112 Optimal Milking(floyd+…
- POJ 2247 Humble Numbers
- POJ 1753 Flip Game
- POJ 1182 食物链
- POJ 3185 The Water Bowls
- POj 2379 ACM Rank Table
- POJ 1018 Communication System
- POJ 1050 To the Max
- poj 2186 Popular Cows
- poj 3249 Test for Job dp(动态规…
- poj 1364 King 差分约束
- poj 1698
- poj 1273
- poj 2112 网络流
- poj 2455 二分+网络流
- 网络流16数字梯形问题
- poj 1149 网络流
- poj 3204 网络流
- poj 2236 并查集
- poj 1182 并查集
- poj 1020 搜索
- poj 2488