最大流建图比较容易第一次Dicnc抄了下别人的版 存一下以后方便查 #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <stack> #include <queue> #include <cctype> #include <cstdi…
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…
题目大意:有n个带有裂缝的冰块.已知每个冰块的坐标和已经站在上面的企鹅数目,每当一个企鹅从一个冰块a跳到另一个冰块b上的时候,冰块a上的裂缝便增大一点,还知道每个冰块上最多能被跳跃的次数.所有的企鹅都想聚集在同一个冰块上并且都不想掉进水里,如果给出每只企鹅能跳跃的最大距离D,问哪几个冰块能让所有的企鹅聚集在一起? 题目分析:枚举所有的冰块,依次判断其是否满足题意.将每一个冰块视作一个节点,以冰块间企鹅能否跳跃建边,得到一张节点带有容量的图.对于节点容量的图拆点.以当前枚举的冰块为汇点t,增加源点…
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…
题目大意:在南极生活着一些企鹅,这些企鹅站在一些冰块上,现在要让这些企鹅都跳到同一个冰块上.但是企鹅有最大的跳跃距离,每只企鹅从冰块上跳走时会给冰块造成损害,因此企鹅跳离每个冰块都有次数限制.找出企鹅可以在哪些冰块上聚齐. 解题思路:(最大流 + 拆点)把每个冰块看做一个点,然后每个点拆分成两个相连的点,容量为最大的跳走次数.添加一个源点,源点到每个冰块代表的点连边,容量为开始冰块上的企鹅数目.枚举判断每个冰块是否满足条件. 代码: #include<iostream> #include<…
题意:在靠近南极的某处,一些企鹅站在许多漂浮的冰块上.由于企鹅是群居动物,所以它们想要聚集到一起,在同一个冰块上.企鹅们不想把自己的身体弄湿,所以它们在冰块之间跳跃,但是它们的跳跃距离,有一个上限. 随着气温的升高,冰块开始融化,并出现了裂痕.而企鹅跳跃的压力,使得冰块的破裂加速.幸运的是,企鹅对冰块十分有研究,它们能知道每块冰块最多能承受多少次跳跃.对冰块的损害只在跳起的时候产生,而落地时并不对其产生伤害. 现在让你来帮助企鹅选择一个冰面使得它们可以聚集到一起. 第一行整数N,和浮点数D,表示…
  题意大意 在X,Y坐标系中有N(N<=100)个冰块,有些冰块上有1若干只企鹅,每只企鹅一次最多跳M距离,一个冰块在有Mi个企鹅离开,就会消失,问有哪些冰块可以作为集合点,就是所有企鹅都能成功到这个冰块上来 题目分析  枚举点作为结束点,由于每个点有出企鹅的限制,用拆点来解决,一个点拆成"起点"和"终点",“起点"到"终点"的流量为最大离开企鹅数,而超级源点与每个点的"起点"做边,容量为其企鹅的数量,再根据…
题目链接: http://acm.hust.edu.cn/vjudge/problem/48415 It Can Be Arranged Time Limit: 3000MS 问题描述 Every year, several universities arrange inter-university national programming contests. ACM ICPC Dhaka site regional competition is held every year in Dhaka…
[题意] 有n个队伍进行比赛,每场比赛,恰好有一支队伍取胜.一支队伍败.每个队伍需要打的比赛场数相同,给你每个队伍目前已经赢得场数和输得场数,再给你一个矩阵,第 i 行第 j 列 表示队伍 i 和队伍 j 还需要打的比赛数,问你哪些队伍有可能获得冠军(胜场最多的即为冠军,可以并列). InputThe input consists of T test cases. The number of test cases (T) is given in the first line of the inp…