poj2391 Ombrophobic Bovines 题解】的更多相关文章

http://poj.org/problem?id=2391 floyd+网络流+二分 题意:有一个有向图,里面每个点有ai头牛,快下雨了牛要躲进雨棚里,每个点有bi个雨棚,每个雨棚只能躲1头牛.牛可以通过点之间的边移动来躲到其他的点的雨棚,路很宽一次可以走无数头牛,路的权是牛走过这条路要的时间.求最短需要多少时间所有牛都躲到雨棚下. 题解: 先floyd求出每个点到每个点的最短时间!然后二分答案,也就是二分牛躲完的时间,然后大于这个时间的路都封了,建个碉图,每个点分成两个点A和B,起点连接到所…
/** 题目:poj2391 Ombrophobic Bovines 链接:http://poj.org/problem?id=2391 题意:有n块区域,第i块区域有ai头奶牛,以及一个可以容纳bi头奶牛的棚子.n块区域由m条可以容纳无数奶牛经过的双向通道相连,给定奶牛通过通道的时间. 问所有奶牛回到棚子需要的最短时间. 思路:...我好菜哦.没想到,看了blog才知道怎么做. 先用floyd求得两块区域相通最短时间. 将点x拆分成x,x'.源点s连接x,容量为x的奶牛数.x'连接汇点t容量为…
                     Ombrophobic Bovines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18205   Accepted: 3960 Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in…
Ombrophobic Bovines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19359   Accepted: 4186 Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They h…
题目链接: id=2391">poj2391 题意: 有n块草地,每块草地上有一定数量的奶牛和一个雨棚,并给出了每一个雨棚的容(牛)量. 有m条路径连接这些草地  ,这些路径是双向的,并且非常宽敞,能够容下无限条牛并排走, 给出经过每条路径所须要消耗的时间 问:全部牛都到达雨棚下的最小时间 解题思路: 类似    牛与挤奶器的问题 http://blog.csdn.net/axuan_k/article/details/45920969  已给出基本思路 与上题最大的差别是: 草地既连接源…
Ombrophobic Bovines Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 21660Accepted: 4658 题目链接:http://poj.org/problem?id=2391 Description: FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes the…
一道水题WA了这么多次真是.... 统考终于完 ( 挂 ) 了...可以好好写题了... 先floyd跑出各个点的最短路 , 然后二分答案 m , 再建图. 每个 farm 拆成一个 cow 点和一个 shelter 点, 然后对于每个 farm x : S -> cow( x ) = cow( x ) 数量 , shelter( x ) -> T = shelter( x ) 容量 ; 对于每个dist( u , v ) <= m 的 cow( u ) -> shelter( v…
poj 2391 Ombrophobic Bovines, 最大流, 拆点, 二分 dinic /* * Author: yew1eb * Created Time: 2014年10月31日 星期五 15时39分22秒 * File Name: poj2391.cpp */ #include <ctime> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring&g…
Ombrophobic Bovines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18623   Accepted: 4057 Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They h…
Ombrophobic Bovines Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 14519Accepted: 3170 Description FJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They have de…