March of the Penguins Time Limit: 8000MS   Memory Limit: 65536K Total Submissions: 4873   Accepted: 2220 Description Somewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would l…
题目大意:在南极生活着一些企鹅,这些企鹅站在一些冰块上,现在要让这些企鹅都跳到同一个冰块上.但是企鹅有最大的跳跃距离,每只企鹅从冰块上跳走时会给冰块造成损害,因此企鹅跳离每个冰块都有次数限制.找出企鹅可以在哪些冰块上聚齐. 解题思路:(最大流 + 拆点)把每个冰块看做一个点,然后每个点拆分成两个相连的点,容量为最大的跳走次数.添加一个源点,源点到每个冰块代表的点连边,容量为开始冰块上的企鹅数目.枚举判断每个冰块是否满足条件. 代码: #include<iostream> #include<…
March of the Penguins Time Limit: 8000MS   Memory Limit: 65536K Total Submissions: 4378   Accepted: 1988 Description Somewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would l…
Description Somewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would like to get together, all on the same floe. The penguins do not want to get wet, so they have use their li…
March of the Penguins Time Limit: 8000MS   Memory Limit: 65536K Total Submissions: 4809   Accepted: 2195 Description Somewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would l…
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…
题目链接:http://poj.org/problem?id=3498 思路:首先设一个超级源点,将源点与各地相连,边容量为各点目前的企鹅数量,然后就是对每个冰块i进行拆点了(i,i+n),边容量为能够接受的受损程度,这样就把点权问题转化为边权问题了,然后就是对于那些能够相互跳跃的冰块之间连边(i+n,j),(j+n,i),边容量为inf.最后就是枚举汇点看是否等于总数. #include<iostream> #include<cstdio> #include<cstring…
题目大意:有n个带有裂缝的冰块.已知每个冰块的坐标和已经站在上面的企鹅数目,每当一个企鹅从一个冰块a跳到另一个冰块b上的时候,冰块a上的裂缝便增大一点,还知道每个冰块上最多能被跳跃的次数.所有的企鹅都想聚集在同一个冰块上并且都不想掉进水里,如果给出每只企鹅能跳跃的最大距离D,问哪几个冰块能让所有的企鹅聚集在一起? 题目分析:枚举所有的冰块,依次判断其是否满足题意.将每一个冰块视作一个节点,以冰块间企鹅能否跳跃建边,得到一张节点带有容量的图.对于节点容量的图拆点.以当前枚举的冰块为汇点t,增加源点…
题意:在靠近南极的某处,一些企鹅站在许多漂浮的冰块上.由于企鹅是群居动物,所以它们想要聚集到一起,在同一个冰块上.企鹅们不想把自己的身体弄湿,所以它们在冰块之间跳跃,但是它们的跳跃距离,有一个上限. 随着气温的升高,冰块开始融化,并出现了裂痕.而企鹅跳跃的压力,使得冰块的破裂加速.幸运的是,企鹅对冰块十分有研究,它们能知道每块冰块最多能承受多少次跳跃.对冰块的损害只在跳起的时候产生,而落地时并不对其产生伤害. 现在让你来帮助企鹅选择一个冰面使得它们可以聚集到一起. 第一行整数N,和浮点数D,表示…
poj3498:http://poj.org/problem?id=3498 题意:某个冰块上有a只企鹅,总共可以跳出去b只,问是否可能所有的企鹅都跳到某一块冰块上,输出所有的可能的冰块的编号. 由于每个点只能跳出去m只企鹅,所以要拆点假如不拆点,一个点到另一个点可能会跳多于m只企鹅通过拆点后u->u'间的容量来完成题目的要求(对点的一些限制) 建图:i->i+n 容量为m i+n->j容量为INF新建源点s,s->i的容量为i点企鹅的个数然后枚举汇点求最大流就可以判断某个点是否符…