随笔分类 - 网络流&&费用流&&二分图
摘要:题意: n 个排成一列的哨站要进行通信。第 i 个哨站的频段为 ai。 每个哨站 ii 需要选择以下二者之一: 1.直接连接到控制中心,代价为 W;2.连接到前面的某个哨站 j(j<i),代价为 |ai−aj|。 每个哨站只能被后面的至多一个哨站连接。 请你求出最小可能的代价和。 题解: 显然的费用
阅读全文
摘要:题意: 有n个士兵,你可以选择让它成为战士还是法师。 有m对关系,u和v 如果同时为战士那么你可以获得a的权值 如果同时为法师,你可以获得c的权值, 如果一个为战士一个是法师,你可以获得b的权值 问你可以获得的最大权值是多少? 题解: 对每个士兵建立一个点x ,点x 向源点s 连一条边,向汇点t 连
阅读全文
摘要:题意:求一个图(不一定联通)最小额外连接几条边,使得可以一笔画出来 大致做法 1.找出联通块 2.统计每一个连通块里面度数为奇数的点的个数, 有一个性质 一个图能够用一笔画出来,奇数点的个数不超过2个 if 奇数点的个数==0 或者 ==1 直接找欧拉回路 else 将除去前面两个奇数点外的奇数点依
阅读全文
摘要:Farmer John and his brothers have found a new land. They are so excited and decide to build new farms on the land. The land is a rectangle and consist
阅读全文
摘要:Xzz is playing a MMORPG "human life". In this game, there are N different skills. Some skills may base on another skill. Learning skill will cost Xzz
阅读全文
摘要:On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to
阅读全文
摘要:Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, the
阅读全文
摘要:Description Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick u
阅读全文
摘要:In modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. You can assume
阅读全文
摘要:CIA headquarter collects data from across the country through its classified network. They have been usingoptical fibres long before it's been deploye
阅读全文
摘要:Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various l
阅读全文
摘要:题目描述 «问题描述: 假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为1,2,3,...的球。 (1)每次只能在某根柱子的最上面放球。 (2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。 试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4 根柱子上最多可放11 个球
阅读全文
摘要:题目描述 «问题描述: 给定有向图G=(V,E)。设P 是G 的一个简单路(顶点不相交)的集合。如果V 中每个顶点恰好在P 的一条路上,则称P是G 的一个路径覆盖。P 中路径可以从V 的任何一个顶点开始,长度也是任意的,特别地,可以为0。G 的最小路径覆盖是G 的所含路径条数最少的路径覆盖。设计一个
阅读全文
摘要:题目描述 英国皇家空军从沦陷国征募了大量外籍飞行员。由皇家空军派出的每一架飞机都需要配备在航行技能和语言上能互相配合的2 名飞行员,其中1 名是英国飞行员,另1名是外籍飞行员。在众多的飞行员中,每一名外籍飞行员都可以与其他若干名英国飞行员很好地配合。如何选择配对飞行的飞行员才能使一次派出最多的飞机。
阅读全文
摘要:题目描述 W 教授正在为国家航天中心计划一系列的太空飞行。每次太空飞行可进行一系列商业性实验而获取利润。现已确定了一个可供选择的实验集合E={E1,E2,…,Em},和进行这些实验需要使用的全部仪器的集合I={I1,I2,…In}。实验Ej需要用到的仪器是I的子集RjÍI。配置仪器Ik的费用为ck美
阅读全文
摘要:Description When Frodo, Sam, Merry, and Pippin are at the Green Dragon Inn drinking ale, they like to play a little game with parchment and pen to dec
阅读全文
摘要:Problem Description In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands
阅读全文
摘要:Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by wa
阅读全文

浙公网安备 33010602011771号